Skip to content
Snippets Groups Projects
Commit fa38a43d authored by Nikolai's avatar Nikolai
Browse files

dump options to json dict

parent 1cce79f1
No related branches found
No related tags found
No related merge requests found
...@@ -47,20 +47,26 @@ class KerasROOTClassification(object): ...@@ -47,20 +47,26 @@ class KerasROOTClassification(object):
dataset_names = ["x_train", "x_test", "y_train", "y_test", "w_train", "w_test"] dataset_names = ["x_train", "x_test", "y_train", "y_test", "w_train", "w_test"]
def __init__(self, name, def __init__(self, name, *args, **kwargs):
signal_trees, bkg_trees, branches, weight_expr, identifiers, self._init_from_args(name, *args, **kwargs)
selection=None, with open(os.path.join(self.project_dir, "options.json"), "w") as of:
layers=3, json.dump(dict(args=args, kwargs=kwargs), of)
nodes=64,
batch_size=128,
validation_split=0.33, def _init_from_args(self, name,
activation_function='relu', signal_trees, bkg_trees, branches, weight_expr, identifiers,
out_dir="./outputs", selection=None,
scaler_type="RobustScaler", layers=3,
step_signal=2, nodes=64,
step_bkg=2, batch_size=128,
optimizer="SGD", validation_split=0.33,
optimizer_opts=None): activation_function='relu',
out_dir="./outputs",
scaler_type="RobustScaler",
step_signal=2,
step_bkg=2,
optimizer="SGD",
optimizer_opts=None):
self.name = name self.name = name
self.signal_trees = signal_trees self.signal_trees = signal_trees
self.bkg_trees = bkg_trees self.bkg_trees = bkg_trees
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment