-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.py
87 lines (69 loc) · 2.35 KB
/
run.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# (c) 2021 Nikolaus Howe
import numpy as np
import random
from jax.config import config
from myriad.experiments.e2e_sysid import run_endtoend
from myriad.experiments.mle_sysid import run_mle_sysid
from myriad.experiments.node_e2e_sysid import run_node_endtoend
from myriad.experiments.node_mle_sysid import run_node_mle_sysid
from myriad.useful_scripts import run_setup, run_trajectory_opt, load_node_and_plan
from myriad.probing_numerical_instability import probe, special_probe
from myriad.utils import integrate_time_independent, yield_minibatches
config.update("jax_enable_x64", True)
run_buddy = False
def main():
#########
# Setup #
#########
hp, cfg = run_setup()
random.seed(hp.seed)
np.random.seed(hp.seed)
if run_buddy:
# random.seed(hp.seed)
# np.random.seed(hp.seed)
import experiment_buddy
experiment_buddy.register(hp.__dict__)
# tensorboard = experiment_buddy.deploy(host='mila', sweep_yaml="sweep.yaml")
tensorboard = experiment_buddy.deploy(host='mila', sweep_yaml="")
# tensorboard = experiment_buddy.deploy(host='', sweep_yaml='')
########################################
# Probing Systems' Numerical Stability #
########################################
# for st in SystemType:
# if st in [SystemType.SIMPLECASE, SystemType.INVASIVEPLANT]:
# continue
# print("system", st)
# hp.system = st
# probe(hp, cfg)
# probe(hp, cfg)
# special_probe(hp, cfg)
###########################################
# Trajectory optimization with true model #
###########################################
run_trajectory_opt(hp, cfg, save_as='traj_opt_example.pdf')
######################
# MLE model learning #
######################
# Parametric, MLE
# run_mle_sysid(hp, cfg)
# NODE, MLE
# run_node_mle_sysid(hp, cfg)
#############################
# End to end model learning #
#############################
# Parametric, end-to-end
# run_endtoend(hp, cfg)
# NODE, end-to-end
# run_node_endtoend(hp, cfg)
###############
# Noise study #
###############
# study_noise(hp, cfg, experiment_string='mle_sysid')
# study_noise(hp, cfg, experiment_string='node_mle_sysid')
##################
# Dynamics study #
##################
# study_vector_field(hp, cfg, 'mle', 0)
# study_vector_field(hp, cfg, 'e2e', 0, file_extension='pdf')
if __name__ == '__main__':
main()