|
from easydict import EasyDict |
|
|
|
collector_env_num = 8 |
|
evaluator_env_num = 8 |
|
|
|
main_config = dict( |
|
exp_name='HAPPO_result/multi_mujoco_halfcheetah_2x3_mappo', |
|
env=dict( |
|
scenario='HalfCheetah-v2', |
|
agent_conf="2x3", |
|
agent_obsk=2, |
|
add_agent_id=False, |
|
episode_limit=1000, |
|
collector_env_num=collector_env_num, |
|
evaluator_env_num=evaluator_env_num, |
|
n_evaluator_episode=8, |
|
stop_value=6000, |
|
), |
|
policy=dict( |
|
cuda=True, |
|
multi_agent=True, |
|
action_space='continuous', |
|
model=dict( |
|
|
|
|
|
agent_num=2, |
|
|
|
|
|
|
|
|
|
agent_obs_shape=8, |
|
|
|
global_obs_shape=17, |
|
|
|
|
|
|
|
action_shape=3, |
|
|
|
|
|
action_space='continuous' |
|
), |
|
|
|
learn=dict( |
|
epoch_per_collect=5, |
|
batch_size=800, |
|
learning_rate=5e-4, |
|
|
|
|
|
|
|
|
|
value_weight=0.5, |
|
|
|
entropy_weight=0.001, |
|
|
|
clip_ratio=0.2, |
|
|
|
adv_norm=True, |
|
value_norm=True, |
|
ppo_param_init=True, |
|
grad_clip_type='clip_norm', |
|
grad_clip_value=5, |
|
), |
|
collect=dict(env_num=collector_env_num, n_sample=3200), |
|
eval=dict(env_num=evaluator_env_num, evaluator=dict(eval_freq=1000, )), |
|
), |
|
) |
|
main_config = EasyDict(main_config) |
|
create_config = dict( |
|
env=dict( |
|
type='mujoco_multi', |
|
import_names=['dizoo.multiagent_mujoco.envs.multi_mujoco_env'], |
|
), |
|
env_manager=dict(type='subprocess'), |
|
policy=dict(type='ppo'), |
|
) |
|
create_config = EasyDict(create_config) |
|
|
|
if __name__ == '__main__': |
|
from ding.entry import serial_pipeline_onpolicy |
|
serial_pipeline_onpolicy((main_config, create_config), seed=0, max_env_step=int(1e7)) |
|
|