Upload policy_config.py with huggingface_hub
Browse files- policy_config.py +109 -0
policy_config.py
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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': 2000,
|
14 |
+
'n_evaluator_episode': 8,
|
15 |
+
'env_id': 'SpaceInvadersNoFrameskip-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': [128, 128, 256, 256],
|
26 |
+
'critic_head_hidden_size': 256,
|
27 |
+
'critic_head_layer_num': 3,
|
28 |
+
'actor_head_hidden_size': 256,
|
29 |
+
'actor_head_layer_num': 3
|
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': 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': 500,
|
69 |
+
'render': {
|
70 |
+
'render_freq': -1,
|
71 |
+
'mode': 'train_iter'
|
72 |
+
},
|
73 |
+
'figure_path': None,
|
74 |
+
'cfg_type': 'InteractionSerialEvaluatorDict',
|
75 |
+
'stop_value': 2000,
|
76 |
+
'n_episode': 8
|
77 |
+
}
|
78 |
+
},
|
79 |
+
'other': {
|
80 |
+
'replay_buffer': {
|
81 |
+
'replay_buffer_size': 64000,
|
82 |
+
'max_use': 16,
|
83 |
+
'sliced': True
|
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 |
+
'random_collect_size': 5000
|
99 |
+
},
|
100 |
+
'exp_name': 'SpaceInvadersNoFrameskip-v4-IMPALA',
|
101 |
+
'seed': 0,
|
102 |
+
'wandb_logger': {
|
103 |
+
'gradient_logger': True,
|
104 |
+
'video_logger': True,
|
105 |
+
'plot_logger': True,
|
106 |
+
'action_logger': True,
|
107 |
+
'return_logger': False
|
108 |
+
}
|
109 |
+
}
|