Upload policy_config.py with huggingface_hub
Browse files- policy_config.py +108 -0
policy_config.py
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
exp_config = {
|
2 |
+
'env': {
|
3 |
+
'manager': {
|
4 |
+
'episode_num': float("inf"),
|
5 |
+
'max_retry': 1,
|
6 |
+
'retry_type': 'reset',
|
7 |
+
'auto_reset': True,
|
8 |
+
'step_timeout': None,
|
9 |
+
'reset_timeout': None,
|
10 |
+
'retry_waiting_time': 0.1,
|
11 |
+
'cfg_type': 'BaseEnvManagerDict'
|
12 |
+
},
|
13 |
+
'stop_value': 30,
|
14 |
+
'n_evaluator_episode': 8,
|
15 |
+
'env_id': 'PongNoFrameskip-v4',
|
16 |
+
'collector_env_num': 8,
|
17 |
+
'evaluator_env_num': 8,
|
18 |
+
'fram_stack': 4,
|
19 |
+
'env_wrapper': 'atari_default'
|
20 |
+
},
|
21 |
+
'policy': {
|
22 |
+
'model': {
|
23 |
+
'obs_shape': [4, 84, 84],
|
24 |
+
'action_shape': 6,
|
25 |
+
'encoder_hidden_size_list': [64, 128, 256],
|
26 |
+
'critic_head_hidden_size': 256,
|
27 |
+
'critic_head_layer_num': 2,
|
28 |
+
'actor_head_hidden_size': 256,
|
29 |
+
'actor_head_layer_num': 2
|
30 |
+
},
|
31 |
+
'learn': {
|
32 |
+
'learner': {
|
33 |
+
'train_iterations': 1000000000,
|
34 |
+
'dataloader': {
|
35 |
+
'num_workers': 0
|
36 |
+
},
|
37 |
+
'log_policy': True,
|
38 |
+
'hook': {
|
39 |
+
'load_ckpt_before_run': '',
|
40 |
+
'log_show_after_iter': 100,
|
41 |
+
'save_ckpt_after_iter': 10000,
|
42 |
+
'save_ckpt_after_run': True
|
43 |
+
},
|
44 |
+
'cfg_type': 'BaseLearnerDict'
|
45 |
+
},
|
46 |
+
'update_per_collect': 2,
|
47 |
+
'batch_size': 128,
|
48 |
+
'learning_rate': 0.0006,
|
49 |
+
'value_weight': 0.5,
|
50 |
+
'entropy_weight': 0.01,
|
51 |
+
'discount_factor': 0.99,
|
52 |
+
'lambda_': 0.95,
|
53 |
+
'rho_clip_ratio': 1.0,
|
54 |
+
'c_clip_ratio': 1.0,
|
55 |
+
'rho_pg_clip_ratio': 1.0,
|
56 |
+
'grad_clip_type': 'clip_norm',
|
57 |
+
'clip_value': 0.5
|
58 |
+
},
|
59 |
+
'collect': {
|
60 |
+
'collector': {
|
61 |
+
'collect_print_freq': 1000
|
62 |
+
},
|
63 |
+
'n_sample': 16,
|
64 |
+
'unroll_len': 64
|
65 |
+
},
|
66 |
+
'eval': {
|
67 |
+
'evaluator': {
|
68 |
+
'eval_freq': 2000,
|
69 |
+
'render': {
|
70 |
+
'render_freq': -1,
|
71 |
+
'mode': 'train_iter'
|
72 |
+
},
|
73 |
+
'figure_path': None,
|
74 |
+
'cfg_type': 'InteractionSerialEvaluatorDict',
|
75 |
+
'stop_value': 30,
|
76 |
+
'n_episode': 8
|
77 |
+
}
|
78 |
+
},
|
79 |
+
'other': {
|
80 |
+
'replay_buffer': {
|
81 |
+
'replay_buffer_size': 10000,
|
82 |
+
'max_use': 16,
|
83 |
+
'sliced': False
|
84 |
+
}
|
85 |
+
},
|
86 |
+
'on_policy': False,
|
87 |
+
'cuda': True,
|
88 |
+
'multi_gpu': False,
|
89 |
+
'bp_update_sync': True,
|
90 |
+
'traj_len_inf': False,
|
91 |
+
'type': 'impala',
|
92 |
+
'priority': False,
|
93 |
+
'priority_IS_weight': False,
|
94 |
+
'action_space': 'discrete',
|
95 |
+
'unroll_len': 64,
|
96 |
+
'transition_with_policy_data': True,
|
97 |
+
'cfg_type': 'IMPALAPolicyDict'
|
98 |
+
},
|
99 |
+
'exp_name': 'PongNoFrameskip-v4-IMPALA',
|
100 |
+
'seed': 0,
|
101 |
+
'wandb_logger': {
|
102 |
+
'gradient_logger': True,
|
103 |
+
'video_logger': True,
|
104 |
+
'plot_logger': True,
|
105 |
+
'action_logger': True,
|
106 |
+
'return_logger': False
|
107 |
+
}
|
108 |
+
}
|