Commit 2f6b970a authored by Marc Arene's avatar Marc Arene
Browse files

Better timing of durations in phase 2

parent c7c4ee6f
......@@ -266,7 +266,6 @@ if __name__ == '__main__':
ifo.psd_array = ifo.power_spectral_density_array
ifo.inverse_psd_array = 1 / ifo.psd_array
# import IPython; IPython.embed();sys.exit()
# WAVEFORM GENERATION
......@@ -715,6 +714,7 @@ if __name__ == '__main__':
sys.exit()
if not(phase3_ongoing):
start_phase2 = time.time()
# SET THE TRAINING SET AND VALIDATION SET FROM PHASE1 POINTS
# validation_split = 0.5
# train_prop = 0.5019635844341307 # corresponds to 281200 when 560200 total
......@@ -800,7 +800,6 @@ if __name__ == '__main__':
cut.logger.info(f'Loading the {fit_method.nick_name} fit from saved directory {global_fit_dir_specific}...')
fit_method.load(global_fit_dir)
else:
start = time.time()
if opts.fit_method == 'cubic':
fit_method.fit(x_train, y_train)
elif opts.fit_method == 'dnn':
......@@ -824,9 +823,9 @@ if __name__ == '__main__':
# fit_method.new_x_for_train = x_val.tolist()
# fit_method.new_y_for_train = y_val.tolist()
stop = time.time()
duration2 += stop - start
cut.logger.info(f"Total time for the fitting part of the algorithm : {duration2/3600:.3} hours")
# stop = time.time()
# duration2 += stop - start
cut.logger.info(f"Total time for the fitting part of the algorithm : {(time.time()-start_phase2)/60:.0f}min.")
cut.logger.info('Saving global fit data for future load...')
fit_method.save(global_fit_dir)
......@@ -908,7 +907,7 @@ if __name__ == '__main__':
length_traj_stuck_min = 20
acc_threshold = 0.4
if tuning_epsilon and not(phase3_ongoing):
start = time.time()
start_tune_eps = time.time()
locs_eps = []
accs_eps = []
costs_adhoc_eps = []
......@@ -1005,12 +1004,12 @@ if __name__ == '__main__':
# time_per_traj_opt = time_per_traj_eps[idx_opt]
cut.logger.info(f'Setting the stepsize for Phase III to epsilon = {eps_opt:.2e}.')
duration_tun_eps = time.time() - start
duration_tun_eps = time.time() - start_tune_eps
cut.logger.info(f'Stepsize optimization lasted {duration_tun_eps/60:.0f}min.')
# sys.exit()
else:
eps_opt = 1.02e-2
acc_opt = 0.588
eps_opt = 2.37e-02
acc_opt = 0.403
time_per_traj_opt = 1.063490
cut.logger.info(f'')
cut.logger.info(f'No tuning of stepsize, setting directly epsilon to {eps_opt} and expected acc to {acc_opt:.1%}')
......@@ -1170,8 +1169,8 @@ if __name__ == '__main__':
sampler.samples = []
sampler.chain_metrics = []
duration2 += time.time() - start_phase2
cut.logger.info(f'Phase II lasted a total of {duration2/60:.0f}min.')
#*************************************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment