Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot setup and netconfig #22

Open
wants to merge 3 commits into
base: legacyAnalysis
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pyrootsOfTheCaribbean/plot_configs/setupPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
# dictionary for colors
def GetPlotColor( cls ):
color_dict = {
"ttZ": ROOT.kCyan,
"ttH": ROOT.kBlue+1,
"ttH_1": 830,
"ttH_2": 418,
"ttH_3": 433,
"ttH_4": 867,
"ttH_5": 602,
"ttZ": ROOT.kCyan,
"ttlf": ROOT.kRed-7,
"ttcc": ROOT.kRed+1,
"ttbb": ROOT.kRed+3,
Expand All @@ -24,7 +29,7 @@ def GetPlotColor( cls ):
}

if "ttZ" in cls: cls = "ttZ"
if "ttH" in cls: cls = "ttH"
if "ttH" in cls and cls not in color_dict: cls = "ttH"
return color_dict[cls]

def GetyTitle(privateWork = False):
Expand Down
154 changes: 154 additions & 0 deletions train_scripts/net_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@
"earlystopping_epochs": 100,
}

config_dict["binary_config_v2"] = {
"layers": [200,100],
"loss_function": "binary_crossentropy",
"Dropout": 0.30,
"L2_Norm": 1e-3,
"L1_Norm": 1e-4,
"batch_size": 64,
"optimizer": optimizers.Adam(1e-3),
"activation_function": "elu",
"output_activation": "Sigmoid",
"earlystopping_percentage": 0.02,
"earlystopping_epochs": 100,
}

config_dict["binary_squared_Adadelta"] = {
"layers": [200,100],
"loss_function": "squared_hinge",
Expand Down Expand Up @@ -162,3 +176,143 @@
"earlystopping_percentage": 0.02,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017"] = {
"layers": [500,200,50],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 1000,
"optimizer": optimizers.Adam(1e-4),
"activation_function": "elu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017_1"] = {
"layers": [50,50],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 1000,
"optimizer": optimizers.Adam(1e-4),
"activation_function": "elu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017_2"] = {
"layers": [50,50,50],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 1000,
"optimizer": optimizers.Adam(1e-4),
"activation_function": "elu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017_3"] = {
"layers": [100,75,50,25,10],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 1000,
"optimizer": optimizers.Adam(1e-4),
"activation_function": "elu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017_4"] = {
"layers": [50,50],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 200,
"optimizer": optimizers.Adagrad(),
"activation_function": "leakyrelu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017_5"] = {
"layers": [50,50,50],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 200,
"optimizer": optimizers.Adagrad(),
"activation_function": "leakyrelu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017_6"] = {
"layers": [100,75,50,25,10],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 200,
"optimizer": optimizers.Adagrad(),
"activation_function": "leakyrelu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017_7"] = {
"layers": [1000],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 200,
"optimizer": optimizers.Adagrad(),
"activation_function": "leakyrelu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017_8"] = {
"layers": [10,10,10,10,10,10,10],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 200,
"optimizer": optimizers.Adagrad(),
"activation_function": "leakyrelu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}

config_dict["STXS_2017_9"] = {
"layers": [10,25,50,75,100],
"loss_function": "categorical_crossentropy",
"Dropout": 0.50,
"L1_Norm": 0.,
"L2_Norm": 1e-5,
"batch_size": 200,
"optimizer": optimizers.Adagrad(),
"activation_function": "leakyrelu",
"output_activation": "Softmax",
"earlystopping_percentage": 0.05,
"earlystopping_epochs": 100,
}
41 changes: 41 additions & 0 deletions utils/mergeVariableSets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import sys
import os
import optparse
import imp

parser = optparse.OptionParser()
parser.add_option("--jt", dest="jtregions",
help = "comma separated list of jet tag regions",
default = "4j_ge3t,5j_ge3t,ge6j_ge3t")
parser.add_option("-o", dest = "output",
help = "output path of new variable set",
default = "merged_variableset.py")
(opts, args) = parser.parse_args()


varsets = []
for i, vset in enumerate(args):
varsets.append(imp.load_source("module{}".format(i),vset))


string = "variables = {}\n"
for jt in opts.jtregions.split(","):
string += "\nvariables[\"{}\"] = [\n".format(jt)

variables = []
for vset in varsets:
variables += vset.variables[jt]

variables = sorted(list(set(variables)))

for v in variables:
string += " \"{}\",\n".format(v)

string += " ]\n\n"

string += "all_variables = list(set( [v for key in variables for v in variables[key] ] ))\n"

with open(opts.output,"w") as f:
f.write(string)
print("wrote variable set to {}".format(opts.output))

Loading