Upload policy_config.py with huggingface_hub
Browse files- policy_config.py +106 -198
policy_config.py
CHANGED
@@ -1,206 +1,114 @@
|
|
1 |
exp_config = {
|
2 |
-
'
|
3 |
-
'
|
4 |
-
|
5 |
-
|
6 |
-
'
|
7 |
-
'
|
8 |
-
'
|
9 |
-
'
|
10 |
-
'
|
11 |
-
'
|
12 |
-
'
|
13 |
-
|
14 |
-
'wait_num': float("inf"),
|
15 |
-
'step_wait_timeout': None,
|
16 |
-
'connect_timeout': 60,
|
17 |
-
'reset_inplace': False,
|
18 |
-
'cfg_type': 'SyncSubprocessEnvManagerDict',
|
19 |
-
'type': 'subprocess'
|
20 |
-
},
|
21 |
-
'stop_value':
|
22 |
-
10000000000,
|
23 |
-
'n_evaluator_episode':
|
24 |
-
3,
|
25 |
-
'type':
|
26 |
-
'cartpole_lightzero',
|
27 |
-
'import_names':
|
28 |
-
['zoo.classic_control.cartpole.envs.cartpole_lightzero_env'],
|
29 |
-
'env_id':
|
30 |
-
'CartPole-v0',
|
31 |
-
'continuous':
|
32 |
-
False,
|
33 |
-
'manually_discretization':
|
34 |
-
False,
|
35 |
-
'replay_path':
|
36 |
-
'/tmp/tmp4kdr3rf1/videos'
|
37 |
-
},
|
38 |
-
'policy': {
|
39 |
-
'model': {
|
40 |
-
'model_type': 'mlp',
|
41 |
-
'continuous_action_space': False,
|
42 |
-
'observation_shape': 4,
|
43 |
-
'self_supervised_learning_loss': True,
|
44 |
-
'categorical_distribution': True,
|
45 |
-
'image_channel': 1,
|
46 |
-
'frame_stack_num': 1,
|
47 |
-
'num_res_blocks': 1,
|
48 |
-
'num_channels': 64,
|
49 |
-
'support_scale': 300,
|
50 |
-
'bias': True,
|
51 |
-
'discrete_action_encoding_type': 'one_hot',
|
52 |
-
'res_connection_in_dynamics': True,
|
53 |
-
'norm_type': 'BN',
|
54 |
-
'action_space_size': 2,
|
55 |
-
'lstm_hidden_size': 128,
|
56 |
-
'latent_state_dim': 128
|
57 |
-
},
|
58 |
-
'learn': {
|
59 |
-
'learner': {
|
60 |
-
'train_iterations': 1000000000,
|
61 |
-
'dataloader': {
|
62 |
-
'num_workers': 0
|
63 |
-
},
|
64 |
-
'log_policy': True,
|
65 |
-
'hook': {
|
66 |
-
'load_ckpt_before_run': '',
|
67 |
-
'log_show_after_iter': 100,
|
68 |
-
'save_ckpt_after_iter': 10000,
|
69 |
-
'save_ckpt_after_run': True
|
70 |
-
},
|
71 |
-
'cfg_type': 'BaseLearnerDict'
|
72 |
-
}
|
73 |
-
},
|
74 |
-
'collect': {
|
75 |
-
'collector': {
|
76 |
-
'deepcopy_obs': False,
|
77 |
-
'transform_obs': False,
|
78 |
-
'collect_print_freq': 100,
|
79 |
-
'cfg_type': 'SampleSerialCollectorDict',
|
80 |
-
'type': 'sample'
|
81 |
-
}
|
82 |
-
},
|
83 |
-
'eval': {
|
84 |
-
'evaluator': {
|
85 |
-
'eval_freq': 1000,
|
86 |
-
'render': {
|
87 |
-
'render_freq': -1,
|
88 |
-
'mode': 'train_iter'
|
89 |
-
},
|
90 |
-
'figure_path': None,
|
91 |
-
'cfg_type': 'InteractionSerialEvaluatorDict',
|
92 |
-
'stop_value': 10000000000,
|
93 |
-
'n_episode': 3
|
94 |
}
|
95 |
},
|
96 |
-
'
|
97 |
-
'
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
'
|
104 |
-
'
|
105 |
-
'
|
106 |
-
'
|
107 |
-
'
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
},
|
112 |
-
'window_seconds': 30,
|
113 |
-
'sample_min_limit_ratio': 1
|
114 |
-
},
|
115 |
-
'monitor': {
|
116 |
-
'sampled_data_attr': {
|
117 |
-
'average_range': 5,
|
118 |
-
'print_freq': 200
|
119 |
-
},
|
120 |
-
'periodic_thruput': {
|
121 |
-
'seconds': 60
|
122 |
-
}
|
123 |
-
},
|
124 |
-
'cfg_type': 'AdvancedReplayBufferDict'
|
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 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
'
|
184 |
-
'type': 'linear',
|
185 |
-
'start': 1.0,
|
186 |
-
'end': 0.05,
|
187 |
-
'decay': 100000
|
188 |
},
|
189 |
-
'
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
},
|
197 |
-
'
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
}
|
206 |
}
|
|
|
1 |
exp_config = {
|
2 |
+
'main_config': {
|
3 |
+
'exp_name': 'CartPole-v0-MuZero',
|
4 |
+
'seed': 0,
|
5 |
+
'env': {
|
6 |
+
'env_id': 'CartPole-v0',
|
7 |
+
'continuous': False,
|
8 |
+
'manually_discretization': False,
|
9 |
+
'collector_env_num': 8,
|
10 |
+
'evaluator_env_num': 3,
|
11 |
+
'n_evaluator_episode': 3,
|
12 |
+
'manager': {
|
13 |
+
'shared_memory': False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
},
|
16 |
+
'policy': {
|
17 |
+
'on_policy': False,
|
18 |
+
'cuda': True,
|
19 |
+
'multi_gpu': False,
|
20 |
+
'bp_update_sync': True,
|
21 |
+
'traj_len_inf': False,
|
22 |
+
'model': {
|
23 |
+
'observation_shape': 4,
|
24 |
+
'action_space_size': 2,
|
25 |
+
'model_type': 'mlp',
|
26 |
+
'lstm_hidden_size': 128,
|
27 |
+
'latent_state_dim': 128,
|
28 |
+
'self_supervised_learning_loss': True,
|
29 |
+
'discrete_action_encoding_type': 'one_hot',
|
30 |
+
'norm_type': 'BN'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
},
|
32 |
+
'use_rnd_model': False,
|
33 |
+
'sampled_algo': False,
|
34 |
+
'gumbel_algo': False,
|
35 |
+
'mcts_ctree': True,
|
36 |
+
'collector_env_num': 8,
|
37 |
+
'evaluator_env_num': 3,
|
38 |
+
'env_type': 'not_board_games',
|
39 |
+
'battle_mode': 'play_with_bot_mode',
|
40 |
+
'monitor_extra_statistics': True,
|
41 |
+
'game_segment_length': 50,
|
42 |
+
'transform2string': False,
|
43 |
+
'gray_scale': False,
|
44 |
+
'use_augmentation': False,
|
45 |
+
'augmentation': ['shift', 'intensity'],
|
46 |
+
'ignore_done': False,
|
47 |
+
'update_per_collect': 100,
|
48 |
+
'model_update_ratio': 0.1,
|
49 |
+
'batch_size': 256,
|
50 |
+
'optim_type': 'Adam',
|
51 |
+
'learning_rate': 0.003,
|
52 |
+
'target_update_freq': 100,
|
53 |
+
'target_update_freq_for_intrinsic_reward': 1000,
|
54 |
+
'weight_decay': 0.0001,
|
55 |
+
'momentum': 0.9,
|
56 |
+
'grad_clip_value': 10,
|
57 |
+
'n_episode': 8,
|
58 |
+
'num_simulations': 25,
|
59 |
+
'discount_factor': 0.997,
|
60 |
+
'td_steps': 5,
|
61 |
+
'num_unroll_steps': 5,
|
62 |
+
'reward_loss_weight': 1,
|
63 |
+
'value_loss_weight': 0.25,
|
64 |
+
'policy_loss_weight': 1,
|
65 |
+
'policy_entropy_loss_weight': 0,
|
66 |
+
'ssl_loss_weight': 2,
|
67 |
+
'lr_piecewise_constant_decay': False,
|
68 |
+
'threshold_training_steps_for_final_lr': 50000,
|
69 |
+
'manual_temperature_decay': False,
|
70 |
+
'threshold_training_steps_for_final_temperature': 100000,
|
71 |
+
'fixed_temperature_value': 0.25,
|
72 |
+
'use_ture_chance_label_in_chance_encoder': False,
|
73 |
+
'use_priority': True,
|
74 |
+
'priority_prob_alpha': 0.6,
|
75 |
+
'priority_prob_beta': 0.4,
|
76 |
+
'root_dirichlet_alpha': 0.3,
|
77 |
+
'root_noise_weight': 0.25,
|
78 |
+
'random_collect_episode_num': 0,
|
79 |
+
'eps': {
|
80 |
+
'eps_greedy_exploration_in_collect': False,
|
81 |
+
'type': 'linear',
|
82 |
+
'start': 1.0,
|
83 |
+
'end': 0.05,
|
84 |
+
'decay': 100000
|
85 |
+
},
|
86 |
+
'cfg_type': 'MuZeroPolicyDict',
|
87 |
+
'reanalyze_ratio': 0,
|
88 |
+
'eval_freq': 200,
|
89 |
+
'replay_buffer_size': 1000000
|
|
|
|
|
|
|
|
|
90 |
},
|
91 |
+
'wandb_logger': {
|
92 |
+
'gradient_logger': False,
|
93 |
+
'video_logger': False,
|
94 |
+
'plot_logger': False,
|
95 |
+
'action_logger': False,
|
96 |
+
'return_logger': False
|
97 |
+
}
|
98 |
},
|
99 |
+
'create_config': {
|
100 |
+
'env': {
|
101 |
+
'type':
|
102 |
+
'cartpole_lightzero',
|
103 |
+
'import_names':
|
104 |
+
['zoo.classic_control.cartpole.envs.cartpole_lightzero_env']
|
105 |
+
},
|
106 |
+
'env_manager': {
|
107 |
+
'type': 'subprocess'
|
108 |
+
},
|
109 |
+
'policy': {
|
110 |
+
'type': 'muzero',
|
111 |
+
'import_names': ['lzero.policy.muzero']
|
112 |
+
}
|
113 |
}
|
114 |
}
|