Ejemplo n.º 1
0
##MultiGPU option
#multiGPU = True
#if os.environ["CUDA_VISIBLE_DEVICES"] in ["0", "1","2","3"]:
#  multiGPU = False

#directory name
configDir = '../'
weightDir = 'training/' + era + '/reco' + ch
scoreDir = era + '/score' + ch
assignDir = era + '/assign' + ch

#Options for data preparation
input_files = []
input_features = []
signal_label = gen_label(ch)
input_files.extend(train_files(ch, era))
input_features.extend(input_variables(ch))
input_features.append('genMatch')

label_name = 'genMatch'
bkg_drop_rate = 0.0
train_test_rate = 0.8
plot_figures = True
mass_name = "jet12m"
mass_decorr = False
sklearn_based_overtraining_check = False  #If it set to false, directly plot DNN scores

#Check if the model and files already exist
if not os.path.exists(os.path.join(configDir, weightDir + ver)):
    os.makedirs(os.path.join(configDir, weightDir + ver))
if not os.path.exists(os.path.join(configDir, scoreDir + ver)):
Ejemplo n.º 2
0
  sys.exit()
if len(jetcat) > 3:
  nbjets_cut = int(jetcat[3:4])
  if nbjets_cut not in [2,3,4]:
    print("Check b jet category")
    sys.exit()
else: nbjets_cut = 0

input_features = []
if all_features: input_features.extend(input_variables(jetcat))
else:
  try: input_features.extend(input_selected_bdt(ch, jetcat, era))
  except: input_features.extend(input_variables(jetcat))
input_features.append(label_name)

sig_files, bkg_files = train_files(ch, era)
if not input_only:
  scaleST, scaleTT, scaleTTLJ, scaleTTLL, frac_sig, frac_bkg = evalScale(ch, era, sig_files, bkg_files)
else: scaleST=1.0; scaleTT=1.0; scaleTTLJ=1.0; scaleTTLL=1.0; frac_sig=1.0; frac_bkg=1.0
#input_features.remove('STTT')
#input_features.remove('channel')

import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.05
set_session(tf.Session(config=config))

import keras
from keras.utils import np_utils, multi_gpu_model
from keras.models import Model, Sequential, load_model
Ejemplo n.º 3
0
##MultiGPU option
#multiGPU = True
#if os.environ["CUDA_VISIBLE_DEVICES"] in ["0", "1","2","3"]:
#  multiGPU = False

#directory name
configDir = '../'
weightDir = 'training/' + era + '/reco' + ch
scoreDir = era + '/score' + ch
assignDir = era + '/assign' + ch

#Options for data preparation
input_files = []
input_features = []
signal_label = gen_label(ch)
input_files.extend(train_files(ch, era, exclusive_jetcat))
input_features.extend(input_variables(ch))
input_features.append('genMatch')

label_name = 'genMatch'
bkg_drop_rate = 0.0
#exclusive_jetcat: bkg_drop_rate = 0.8
train_test_rate = 0.8
plot_figures = True
mass_name = "jet12m"
mass_decorr = False
sklearn_based_overtraining_check = False  #If it set to false, directly plot DNN scores

#Check if the model and files already exist
if not os.path.exists(os.path.join(configDir, weightDir + ver)):
    os.makedirs(os.path.join(configDir, weightDir + ver))