Manually set TensorFlow backend for KERAS, add this for example to your ~/.zshrc
export KERAS_BACKEND=tensorflow
- add/change samples used in training
input_samples.addSample("SAMPLENAME"+naming, label = "SAMPLENAME", normalization_weight = FLOAT)
for example
input_samples.addSample("ttHbb"+naming, label = "ttHbb", normalization_weight = 2.)
input_samples.addSample("ttbb"+naming, label = "ttbb")
-
change network architecture
config
if optimizing, otherwise add network architecture to the filenet_configs.py
as dictonary entry in theconfig_dict
to not lose it and execute it with the parser option--netconfig=CONFIGNAME
-
only change DNN training class
dnn = DNN.DNN([...])
propertieseval_metrics
test_percentage
percentage of samples used to test
others are changed with parser options!
To execute with default options use
python train_template.py
or use the following options
-
Category used for training
-c STR
name of the category(ge)[nJets]j_(ge)[nTags]t
(default is4j_ge3t
)
-
Naming/File Options
-o DIR
to change the name of the ouput directory, can be either a string or absolute path (default istest_training
)-i DIR
to change the name of the input directory, can be either a string or absolute path (default isInputFeatures
)-n STR
to adjust the name of the input file generated in preprocessing (default isdnn.h5
)-v FILE
to change the variable Selection, if the file is in/variable_sets/
the name is sufficient, else the absolute path is needed (default isexample_variables
)
-
Training Options
-e INT
change number of training epochs (default is1000
)-s INT
change number of epochs without decrease in validation loss before stopping (default is20
)--netconfig=STR
STR of the config name innet_config
dictonary innet_configs.py
(config in this file will not be used anymore!)
-
Plotting Options
-p
to create plots of the output-l
to create logarithmic plots--printroc
to print ROC value for confusion matrix--privatework
to create private work label--signalclass=STR
to change the plotted signal class (not part of the background stack plot), possible to do a combination, for examplettHbb,ttbb
(default isNone
)
Example:
python train_template.py -i /path/to/input/files/ -o testRun --netconfig=test_config --plot --printroc -c ge6j_ge3t --epochs=1000 --signalclass=ttHbb,ttbb
Re-evaluate DNN after training with
python eval_template.py
using the option -i DIR
to specify the path to the already trained network.
The plotting options of train_template.py
are also avaiable for this script.
Example:
python eval_template.py -i testRun_ge6j_ge3t -o eval_testRun --plot --printroc