|
from easydict import EasyDict |
|
|
|
beergame_ppo_config = dict( |
|
exp_name='beergame_ppo_seed0', |
|
env=dict( |
|
collector_env_num=8, |
|
evaluator_env_num=8, |
|
n_evaluator_episode=8, |
|
stop_value=200, |
|
role=0, |
|
agent_type='bs', |
|
|
|
demandDistribution=0 |
|
|
|
), |
|
policy=dict( |
|
cuda=True, |
|
recompute_adv=True, |
|
action_space='discrete', |
|
model=dict( |
|
obs_shape=50, |
|
action_shape=5, |
|
action_space='discrete', |
|
encoder_hidden_size_list=[64, 64, 128], |
|
actor_head_hidden_size=128, |
|
critic_head_hidden_size=128, |
|
), |
|
learn=dict( |
|
epoch_per_collect=10, |
|
batch_size=320, |
|
learning_rate=3e-4, |
|
entropy_weight=0.001, |
|
adv_norm=True, |
|
value_norm=True, |
|
|
|
|
|
|
|
|
|
ignore_done=True, |
|
), |
|
collect=dict( |
|
n_episode=8, |
|
discount_factor=0.99, |
|
gae_lambda=0.95, |
|
collector=dict( |
|
get_train_sample=True, |
|
reward_shaping=True, |
|
), |
|
), |
|
eval=dict(evaluator=dict(eval_freq=500, )), |
|
), |
|
) |
|
beergame_ppo_config = EasyDict(beergame_ppo_config) |
|
main_config = beergame_ppo_config |
|
beergame_ppo_create_config = dict( |
|
env=dict( |
|
type='beergame', |
|
import_names=['dizoo.beergame.envs.beergame_env'], |
|
), |
|
env_manager=dict(type='base'), |
|
policy=dict(type='ppo'), |
|
collector=dict(type='episode', ), |
|
) |
|
beergame_ppo_create_config = EasyDict(beergame_ppo_create_config) |
|
create_config = beergame_ppo_create_config |
|
|
|
if __name__ == "__main__": |
|
|
|
from ding.entry import serial_pipeline_onpolicy |
|
serial_pipeline_onpolicy([main_config, create_config], seed=0) |
|
|