-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_pruning.py
28 lines (22 loc) · 870 Bytes
/
run_pruning.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
import os
template = "python prune.py --init-dir experiments/{}/{}/ " \
"--multirun --ratio {} --threshold {} --max-epochs 1200 --prune-convergence-its {} {}"
base = "mujoco_noreg"
# envs = ["CartPole-v0","Acrobot-v1","Pendulum-v0","MountainCarContinuous-v0"]
# envs = ['Acrobot-v1']
# threshold = [-200]
# threshold = [10.0,-499.0,-1500.0,0.0]
# base = "mujoco_001"
envs = ["HalfCheetah-v2", "Hopper-v2", "Reacher-v2", "Walker2d-v2"]
threshold = [2000.0, 1500.0, -20.0, 2000.0]
its = 25
exec_list = []
for env, thresh in zip(envs, threshold):
exec_list.append(template.format(base, env, 0.1, thresh, its, ""))
exec_list.append(template.format(base, env, 0.05, thresh, its, "--prune-together"))
print(exec_list[-2])
print(exec_list[-1])
for command in exec_list:
print('-' * 50, '\n\n\n\n')
print(command)
os.system(command)