MCPcopy Create free account
hub / github.com/Victorletzelter/timeMCL / find_last_log_dir

Function find_last_log_dir

tsExperiments/scripts_plot/plotting.py:318–342  ·  view source on GitHub ↗
(dataset, model, num_hyps, suffix=None, seed=None)

Source from the content-addressed store, hash-verified

316 return handles, labels
317
318def find_last_log_dir(dataset, model, num_hyps, suffix=None, seed=None):
319 logdir = os.path.join(os.environ["PROJECT_ROOT"], "tsExperiments", "logs", f"visual_{dataset}", "runs")
320 runs = os.listdir(logdir)
321 runs = [run for run in runs if f"{model}_" in run and f"_{num_hyps}" in run]
322 if seed is not None:
323 runs = [run for run in runs if f"seed_{seed}" in run]
324 if len(runs) == 0:
325 print(f"No runs found for {dataset} {model} {num_hyps}")
326 return None
327 if suffix is not None:
328 runs = [run for run in runs if suffix in run]
329 def split_run_name(run_name):
330 # Extrac
331 if f'seed' in run_name:
332 return time.strptime(run_name.split(f'seed')[0][:-1], '%Y-%m-%d_%H-%M-%S')
333 else:
334 # ignore the run name by setting an early date
335 return time.strptime('1970-01-01_00-00-00', '%Y-%m-%d_%H-%M-%S')
336 runs = sorted(runs, key=split_run_name)
337 if len(runs) == 0:
338 print(f"No runs found for {dataset} {model} {num_hyps} {suffix}")
339 return None
340 else:
341 print(os.path.join(logdir, runs[-1]))
342 return os.path.join(logdir, runs[-1])
343
344def plot_from_logdir(logdir, fname, plot_p, main_color, mean_color, rows, cols, dataset, seed=None):
345

Callers 1

plot_multiple_methodsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected