-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_NMROM_list_cpp.py
More file actions
44 lines (37 loc) · 1.77 KB
/
run_NMROM_list_cpp.py
File metadata and controls
44 lines (37 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from sys import argv
import argparse
from NMROM_simulator_sparse_cpp import NMROM_Simulator
from NMROM_simulator_sparse_cpp_pod import NMROM_POD_Simulator
def simulate(working_path, sim_config):
if sim_config["projection_strategy"] == 'custom':
simulation_routine=NMROM_Simulator(working_path, sim_config, sim_config["best"])
elif sim_config["projection_strategy"] == 'pod':
simulation_routine=NMROM_POD_Simulator(working_path, sim_config)
else:
simulation_routine=None
simulation_routine.execute_simulation()
if __name__ == "__main__":
sim_configs_list=[
# {
# "model_path": 'saved_models_cantilever_big_range/PODANN/PODANN_tf_sonly_diff_svd_white_nostand_Lay[200, 200]_Emb20.60_LRsgdr0.001_slower',
# "projection_strategy": 'custom', # ['custom', 'pod']
# "parameters_selection_strategy": 'random', # ['progressive', 'random']
# "best": 'x'
# }
{
"model_path": 'saved_models_cantilever_big_range/POD/POD_Emb40',
"projection_strategy": 'pod', # ['custom', 'pod']
"parameters_selection_strategy": 'random', # ['progressive', 'random']
}
]
parser = argparse.ArgumentParser()
parser.add_argument('working_path', type=str, help='Root directory to work from.')
# parser.add_argument('--best', type=str, help='Evaluate the best epoch instead of last. can be set to x or r.')
args = parser.parse_args()
working_path = args.working_path+'/'
# best=args.best
for i, sim_config in enumerate(sim_configs_list):
print('---------- Evaluating case ', i+1, ' of ', len(sim_configs_list), ' ----------')
simulate(working_path, sim_config)
# compss_barrier()
print('FINISHED EVALUATING')