Skip to content
Snippets Groups Projects
Commit fa0c217b authored by Krishna Krishna Nikhil's avatar Krishna Krishna Nikhil
Browse files

Update 2 execute.py

parent f6f67281
Branches
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ def reset_weights(m):
if __name__ == "__main__":
multiprocessing.set_start_method('spawn')
outpath = 'FF02'
outpath = 'FF04'
os.system('mkdir '+outpath)
outpath += '/'
......@@ -42,9 +42,9 @@ if __name__ == "__main__":
num_layers = 3
#so far these are only layer thicknesses
start_pars = {'thickness_absorber_0': 20,
start_pars = {'thickness_absorber_0': 35,
'thickness_absorber_1': 17,
'thickness_absorber_2': 35,
'thickness_absorber_2': 20,
#'thickness_absorber_5': .1,
#'thickness_absorber_6': .1,
#'thickness_absorber_7': .1,
......@@ -70,8 +70,8 @@ if __name__ == "__main__":
gen = Generator(box,
Parameters(parameters = start_pars),
n_vars = 25,
n_events_per_var = 200//divide,
n_vars = 40,
n_events_per_var = 400//divide,
particles=[['gamma',0.22,'pi+',2.11]])
......@@ -269,7 +269,7 @@ if __name__ == "__main__":
print("Optimization")
#apply the surrogate model
updated_detector_parameters, optimal, o_loss = optimizer.optimize(surrogate_dataset, batch_size=512, n_epochs=40, lr=0.02, add_constraints=True)#some noise
updated_detector_parameters, optimal, o_loss = optimizer.optimize(surrogate_dataset, batch_size=512, n_epochs=40, lr=0.03, add_constraints=True)#some noise
print("Updated detector parameters: ", gen.translate_parameters(updated_detector_parameters), "; not interrupted", optimal, "; change", updated_detector_parameters - parameters)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment