-
Notifications
You must be signed in to change notification settings - Fork 0
/
default_params_ppo.py
163 lines (162 loc) · 6.75 KB
/
default_params_ppo.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
def get_hyperparams(env_name):
if 'pandaopendoorfk' in env_name:
hyperparams_dict={
'alg_name': 'ppo',
# 'max_steps': 300,
'max_steps': 1000,
'max_episodes': 5000,
'action_range': 0.05, # on joint
# 'action_range': 0.1, # on joint
'batch_size': 640,
'eval_interval': 500, # evaluate the model and save it
'gamma': 0.99, # reward discount
'hidden_dim': 512,
'a_lr': 3e-4,
'c_lr': 3e-4,
'randomized_params': ['knob_friction', 'hinge_stiffness', 'hinge_damping', 'hinge_frictionloss', 'door_mass', 'knob_mass', 'table_position_offset_x', 'table_position_offset_y'], # choose in: 'all', None, or a list of parameter keys
}
elif 'pandaopendoorik' in env_name:
hyperparams_dict={
'alg_name': 'ppo',
# 'max_steps': 300,
'max_steps': 1000,
'max_episodes': 5000,
'action_range': 0.05, # on joint
# 'action_range': 0.1, # on joint
'batch_size': 640,
'eval_interval': 500, # evaluate the model and save it
'gamma': 0.99, # reward discount
'hidden_dim': 512,
'a_lr': 3e-4,
'c_lr': 3e-4,
'randomized_params': ['knob_friction', 'hinge_stiffness', 'hinge_damping', 'hinge_frictionloss', 'door_mass', 'knob_mass', 'table_position_offset_x', 'table_position_offset_y'], # choose in: 'all', None, or a list of parameter keys
}
elif 'pandapushik2dsimple' in env_name: # 'pandapushik2dsimpledynamics' or 'pandapushik2dsimple'
hyperparams_dict={
'alg_name': 'ppo',
# 'max_steps': 300,
'max_steps': 500,
'max_episodes': 5000,
'action_range': 0.1,
'batch_size': 640,
'eval_interval': 500, # evaluate the model and save it
'gamma': 0.99, # reward discount
'hidden_dim': 512,
'a_lr': 3e-4,
'c_lr': 3e-4,
'randomized_params': [
# 'link1_mass', 'link2_mass', 'link3_mass', 'link4_mass', 'link5_mass', 'link6_mass', 'link7_mass',
'joint1_damping', 'joint2_damping', 'joint3_damping', 'joint4_damping', 'joint5_damping', 'joint6_damping', 'joint7_damping',
'joint1_armature', 'joint2_armature', 'joint3_armature', 'joint4_armature', 'joint5_armature', 'joint6_armature', 'joint7_armature',
'actuator_velocity_joint1_kv', 'actuator_velocity_joint2_kv', 'actuator_velocity_joint3_kv', 'actuator_velocity_joint4_kv',
'actuator_velocity_joint5_kv', 'actuator_velocity_joint6_kv', 'actuator_velocity_joint7_kv',
# 'actuator_position_finger_joint1_kp_1000000', 'actuator_position_finger_joint2_kp_1000000',
# 'table_size_0', 'table_size_1', 'table_size_2', 'table_friction_0', 'table_friction_1', 'table_friction_2',
'boxobject_size_0', 'boxobject_size_1', 'boxobject_size_2',
'boxobject_friction_0', 'boxobject_friction_1', 'boxobject_friction_2',
'boxobject_density_1000',
# 'pandaik_z_proportional_gain'
],
'deterministic': True,
}
# TODO
elif env_name == 'pendulum':
hyperparams_dict={
'alg_name': 'td3',
'max_steps': 1000,
'max_episodes': 200,
'action_range': None, # automatically query from env
'batch_size': 640,
'explore_steps': 0,
'update_itr': 100, # iterative update
'eval_interval': 100, # evaluate the model and save it
'explore_noise_scale': 0.6,
'eval_noise_scale': 0.2, # noisy evaluation trick
'reward_scale': 1., # reward normalization
'gamma': 0.9, # reward discount
'soft_tau': 1e-2, # soft udpate coefficient
'hidden_dim': 64,
'noise_decay': 1., # decaying exploration noise
'policy_target_update_interval': 5, # delayed update
'q_lr': 3e-4,
'policy_lr': 3e-4,
'replay_buffer_size': 1e5,
'randomized_params': 'all',
'deterministic': True,
}
elif 'inverteddoublependulum' in env_name:
hyperparams_dict={
'alg_name': 'td3',
'max_steps': 1000,
'max_episodes': 2000,
'action_range': None,
'batch_size': 256,
'explore_steps': 0,
'update_itr': 100, # iterative update
'eval_interval': 200, # evaluate the model and save it
'explore_noise_scale': 0.1,
'eval_noise_scale': 0.2, # noisy evaluation trick
'reward_scale': None, # reward normalization
'gamma': 0.99, # reward discount
'soft_tau': 1e-2, # soft udpate coefficient
'hidden_dim': 256,
'noise_decay': 1., # decaying exploration noise
'policy_target_update_interval': 2, # delayed update
'q_lr': 3e-4,
'policy_lr': 3e-4,
'replay_buffer_size': 1e5,
'randomized_params': 'all',
'deterministic': True,
}
elif 'InvertedDoublePendulum-v2' in env_name:
hyperparams_dict={
'alg_name': 'td3',
'max_steps': 1000,
'max_episodes': 2000,
'action_range': None,
'batch_size': 256,
'explore_steps': 0,
'update_itr': 100, # iterative update
'eval_interval': 100, # evaluate the model and save it
'explore_noise_scale': 0.1,
'eval_noise_scale': 0.2, # noisy evaluation trick
'reward_scale': None, # reward normalization
'gamma': 0.99, # reward discount
'soft_tau': 1e-2, # soft udpate coefficient
'hidden_dim': 256,
'noise_decay': 1., # decaying exploration noise
'policy_target_update_interval': 2, # delayed update
'q_lr': 3e-4,
'policy_lr': 3e-4,
'replay_buffer_size': 1e5,
'randomized_params': None,
'deterministic': True,
}
elif env_name == 'halfcheetah': # not support DR yet
hyperparams_dict={
'alg_name': 'td3',
'max_steps': 1000,
'max_episodes': 2000,
'action_range': None,
'batch_size': 640,
'explore_steps': 0,
'update_itr': 100, # iterative update
'eval_interval': 100, # evaluate the model and save it
'explore_noise_scale': 0.5,
'eval_noise_scale': 0.2, # noisy evaluation trick
'reward_scale': None, # reward normalization
'gamma': 0.9, # reward discount
'soft_tau': 1e-2, # soft udpate coefficient
'hidden_dim': 64,
'noise_decay': 1., # decaying exploration noise
'policy_target_update_interval': 5, # delayed update
'q_lr': 3e-4,
'policy_lr': 3e-4,
'replay_buffer_size': 1e5,
'randomized_params': None,
'deterministic': True,
}
else:
raise NotImplementedError
print('Hyperparameters: ', hyperparams_dict)
return hyperparams_dict