#compDatasets = [sampleDatasets_pf_cpf_sv,["db","sv"],["db","sv"],["db","sv"],["db","sv"]] #compTrainDataCollections = [trainDataCollection_pf_cpf_sv,trainDataCollection_sv,trainDataCollection_sv,trainDataCollection_sv,trainDataCollection_sv] #compTestDataCollections = [testDataCollection_pf_cpf_sv, testDataCollection_sv,testDataCollection_sv,testDataCollection_sv,testDataCollection_sv] from DataCollection import DataCollection if os.path.isdir(compareDir): raise Exception('output directory: %s must not exists yet' % compareDir) else: os.mkdir(compareDir) models = [] testds = [] for i in range(len(compModels)): curModel = loadModel(compTrainDirs[i], compTrainDataCollections[i], compModels[i], compLoadModels[i], compDatasets[i], compRemovals[i]) testd = DataCollection() testd.readFromFile(compTestDataCollections[i]) models.append(curModel) testds.append(testd) #print testd #print testds #makeComparisonPlots(testd,curModel,compNames,compareDir) print testds print models print compNames print compareDir makeComparisonPlots(testds, models, compNames, compareDir)
inputDataset = sampleDatasets_cpf_sv trainDir = opts.d inputTrainDataCollection = opts.i inputTestDataCollection = opts.t LoadModel = False removedVars = None forceNClasses = False signals = [1] sigNames = ['Hbb'] backgrounds = [0] backNames = ['QCD'] NClasses = len(signals) + len(backgrounds) if True: evalModel = loadModel(trainDir, inputTrainDataCollection, trainingModel, LoadModel, forceNClasses, NClasses, inputDataset, removedVars) evalDir = opts.o from DeepJetCore.DataCollection import DataCollection testd = DataCollection() testd.readFromFile(inputTestDataCollection) if os.path.isdir(evalDir): raise Exception('output directory: %s must not exists yet' % evalDir) else: os.mkdir(evalDir) df, features_val = makePlots(testd, evalModel, evalDir) makeLossPlot(trainDir, evalDir)
trainDataCollection = '/cms-sc17/convert_20180401_ak8_deepDoubleB_db_cpf_sv_reduced_6label_train_val/dataCollection.dc' testDataCollection = '/cms-sc17/convert_20180401_ak8_deepDoubleB_db_cpf_sv_reduced_6label_test/dataCollection.dc' datasets = ["db", "cpf", "SV"] removedVars = None LoadModel = True from DeepJet_models_final import conv_model_final as trainingModel from eval_funcs import loadModel, _byteify, makeLossPlot trainDir = "train_2018Samples_60Track_fixed/" #trainDir_massPen = "train_2018Samples_60Track_fixed_BNfixed/" trainDir_massPen = "../independence/example/train_2018Samples_60Track_fixed_lossFunc/" evalModel = loadModel(trainDir, trainDataCollection, trainingModel, LoadModel, datasets) evalModel_massPen = loadModel(trainDir_massPen, trainDataCollection, trainingModel, LoadModel, datasets) #outputDir = "Plots/2018Samples_6Label/" outputDir = "Plots/2018Samples_fixed_31May/" if os.path.isdir(outputDir): shutil.rmtree(outputDir) os.mkdir(outputDir) else: os.mkdir(outputDir) shutil.copy2('plots.py', outputDir) #### READ IN DATA ###