Upload policy_config.py with huggingface_hub
Browse files- policy_config.py +114 -0
policy_config.py
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
exp_config = {
|
2 |
+
'main_config': {
|
3 |
+
'exp_name': 'CartPole-v0-EfficientZero',
|
4 |
+
'env': {
|
5 |
+
'env_id': 'CartPole-v0',
|
6 |
+
'continuous': False,
|
7 |
+
'manually_discretization': False,
|
8 |
+
'collector_env_num': 8,
|
9 |
+
'evaluator_env_num': 3,
|
10 |
+
'n_evaluator_episode': 3,
|
11 |
+
'manager': {
|
12 |
+
'shared_memory': False
|
13 |
+
}
|
14 |
+
},
|
15 |
+
'policy': {
|
16 |
+
'on_policy': False,
|
17 |
+
'cuda': True,
|
18 |
+
'multi_gpu': False,
|
19 |
+
'bp_update_sync': True,
|
20 |
+
'traj_len_inf': False,
|
21 |
+
'model': {
|
22 |
+
'observation_shape': 4,
|
23 |
+
'action_space_size': 2,
|
24 |
+
'model_type': 'mlp',
|
25 |
+
'lstm_hidden_size': 128,
|
26 |
+
'latent_state_dim': 128,
|
27 |
+
'discrete_action_encoding_type': 'one_hot',
|
28 |
+
'norm_type': 'BN'
|
29 |
+
},
|
30 |
+
'use_rnd_model': False,
|
31 |
+
'sampled_algo': False,
|
32 |
+
'gumbel_algo': False,
|
33 |
+
'mcts_ctree': True,
|
34 |
+
'collector_env_num': 8,
|
35 |
+
'evaluator_env_num': 3,
|
36 |
+
'env_type': 'not_board_games',
|
37 |
+
'action_type': 'fixed_action_space',
|
38 |
+
'battle_mode': 'play_with_bot_mode',
|
39 |
+
'monitor_extra_statistics': True,
|
40 |
+
'game_segment_length': 50,
|
41 |
+
'transform2string': False,
|
42 |
+
'gray_scale': False,
|
43 |
+
'use_augmentation': False,
|
44 |
+
'augmentation': ['shift', 'intensity'],
|
45 |
+
'ignore_done': False,
|
46 |
+
'update_per_collect': 100,
|
47 |
+
'model_update_ratio': 0.1,
|
48 |
+
'batch_size': 256,
|
49 |
+
'optim_type': 'Adam',
|
50 |
+
'learning_rate': 0.003,
|
51 |
+
'target_update_freq': 100,
|
52 |
+
'target_update_freq_for_intrinsic_reward': 1000,
|
53 |
+
'weight_decay': 0.0001,
|
54 |
+
'momentum': 0.9,
|
55 |
+
'grad_clip_value': 10,
|
56 |
+
'n_episode': 8,
|
57 |
+
'num_simulations': 25,
|
58 |
+
'discount_factor': 0.997,
|
59 |
+
'td_steps': 5,
|
60 |
+
'num_unroll_steps': 5,
|
61 |
+
'reward_loss_weight': 1,
|
62 |
+
'value_loss_weight': 0.25,
|
63 |
+
'policy_loss_weight': 1,
|
64 |
+
'policy_entropy_loss_weight': 0,
|
65 |
+
'ssl_loss_weight': 2,
|
66 |
+
'lr_piecewise_constant_decay': False,
|
67 |
+
'threshold_training_steps_for_final_lr': 50000,
|
68 |
+
'manual_temperature_decay': False,
|
69 |
+
'threshold_training_steps_for_final_temperature': 100000,
|
70 |
+
'fixed_temperature_value': 0.25,
|
71 |
+
'use_ture_chance_label_in_chance_encoder': False,
|
72 |
+
'use_priority': True,
|
73 |
+
'priority_prob_alpha': 0.6,
|
74 |
+
'priority_prob_beta': 0.4,
|
75 |
+
'root_dirichlet_alpha': 0.3,
|
76 |
+
'root_noise_weight': 0.25,
|
77 |
+
'random_collect_episode_num': 0,
|
78 |
+
'eps': {
|
79 |
+
'eps_greedy_exploration_in_collect': False,
|
80 |
+
'type': 'linear',
|
81 |
+
'start': 1.0,
|
82 |
+
'end': 0.05,
|
83 |
+
'decay': 100000
|
84 |
+
},
|
85 |
+
'cfg_type': 'EfficientZeroPolicyDict',
|
86 |
+
'lstm_horizon_len': 5,
|
87 |
+
'reanalyze_ratio': 0.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': 'efficientzero',
|
111 |
+
'import_names': ['lzero.policy.efficientzero']
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|