fix dict copy issue

This commit is contained in:
Onur 2022-06-29 11:55:40 +02:00
parent 6e06e11cfa
commit a042f9f671

View File

@ -1,5 +1,6 @@
import numpy as np import numpy as np
from gym import register from gym import register
from copy import deepcopy
from . import classic_control, mujoco from . import classic_control, mujoco
from .classic_control.hole_reacher.hole_reacher import HoleReacherEnv from .classic_control.hole_reacher.hole_reacher import HoleReacherEnv
@ -364,7 +365,7 @@ for _v in _versions:
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id)
_env_id = f'{_name[0]}ProMP-{_name[1]}' _env_id = f'{_name[0]}ProMP-{_name[1]}'
kwargs_dict_simple_reacher_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_simple_reacher_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_simple_reacher_promp['wrappers'].append('TODO') # TODO kwargs_dict_simple_reacher_promp['wrappers'].append('TODO') # TODO
kwargs_dict_simple_reacher_promp['movement_primitives_kwargs']['action_dim'] = 2 if "long" not in _v.lower() else 5 kwargs_dict_simple_reacher_promp['movement_primitives_kwargs']['action_dim'] = 2 if "long" not in _v.lower() else 5
kwargs_dict_simple_reacher_promp['phase_generator_kwargs']['tau'] = 2 kwargs_dict_simple_reacher_promp['phase_generator_kwargs']['tau'] = 2
@ -399,7 +400,7 @@ register(
) )
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["DMP"].append("ViaPointReacherDMP-v0") ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["DMP"].append("ViaPointReacherDMP-v0")
kwargs_dict_via_point_reacher_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_via_point_reacher_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_via_point_reacher_promp['wrappers'].append('TODO') # TODO kwargs_dict_via_point_reacher_promp['wrappers'].append('TODO') # TODO
kwargs_dict_via_point_reacher_promp['movement_primitives_kwargs']['action_dim'] = 5 kwargs_dict_via_point_reacher_promp['movement_primitives_kwargs']['action_dim'] = 5
kwargs_dict_via_point_reacher_promp['phase_generator_kwargs']['tau'] = 2 kwargs_dict_via_point_reacher_promp['phase_generator_kwargs']['tau'] = 2
@ -440,7 +441,7 @@ for _v in _versions:
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id)
_env_id = f'{_name[0]}ProMP-{_name[1]}' _env_id = f'{_name[0]}ProMP-{_name[1]}'
kwargs_dict_hole_reacher_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_hole_reacher_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_hole_reacher_promp['wrappers'].append('TODO') # TODO kwargs_dict_hole_reacher_promp['wrappers'].append('TODO') # TODO
kwargs_dict_hole_reacher_promp['ep_wrapper_kwargs']['weight_scale'] = 2 kwargs_dict_hole_reacher_promp['ep_wrapper_kwargs']['weight_scale'] = 2
kwargs_dict_hole_reacher_promp['movement_primitives_kwargs']['action_dim'] = 5 kwargs_dict_hole_reacher_promp['movement_primitives_kwargs']['action_dim'] = 5
@ -485,7 +486,7 @@ for _v in _versions:
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["DMP"].append(_env_id)
_env_id = f'{_name[0]}ProMP-{_name[1]}' _env_id = f'{_name[0]}ProMP-{_name[1]}'
kwargs_dict_alr_reacher_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_alr_reacher_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_alr_reacher_promp['wrappers'].append('TODO') # TODO kwargs_dict_alr_reacher_promp['wrappers'].append('TODO') # TODO
kwargs_dict_alr_reacher_promp['movement_primitives_kwargs']['action_dim'] = 5 if "long" not in _v.lower() else 7 kwargs_dict_alr_reacher_promp['movement_primitives_kwargs']['action_dim'] = 5 if "long" not in _v.lower() else 7
kwargs_dict_alr_reacher_promp['phase_generator_kwargs']['tau'] = 4 kwargs_dict_alr_reacher_promp['phase_generator_kwargs']['tau'] = 4
@ -505,7 +506,7 @@ _versions = ['ALRBeerPong-v0']
for _v in _versions: for _v in _versions:
_name = _v.split("-") _name = _v.split("-")
_env_id = f'{_name[0]}ProMP-{_name[1]}' _env_id = f'{_name[0]}ProMP-{_name[1]}'
kwargs_dict_bp_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_bp_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_bp_promp['wrappers'].append(mujoco.beerpong.NewMPWrapper) kwargs_dict_bp_promp['wrappers'].append(mujoco.beerpong.NewMPWrapper)
kwargs_dict_bp_promp['movement_primitives_kwargs']['action_dim'] = 7 kwargs_dict_bp_promp['movement_primitives_kwargs']['action_dim'] = 7
kwargs_dict_bp_promp['phase_generator_kwargs']['tau'] = 0.8 kwargs_dict_bp_promp['phase_generator_kwargs']['tau'] = 0.8
@ -526,7 +527,7 @@ _versions = ["ALRBeerPongStepBased-v0", "ALRBeerPongFixedRelease-v0"]
for _v in _versions: for _v in _versions:
_name = _v.split("-") _name = _v.split("-")
_env_id = f'{_name[0]}ProMP-{_name[1]}' _env_id = f'{_name[0]}ProMP-{_name[1]}'
kwargs_dict_bp_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_bp_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_bp_promp['wrappers'].append(mujoco.beerpong.NewMPWrapper) kwargs_dict_bp_promp['wrappers'].append(mujoco.beerpong.NewMPWrapper)
kwargs_dict_bp_promp['movement_primitives_kwargs']['action_dim'] = 7 kwargs_dict_bp_promp['movement_primitives_kwargs']['action_dim'] = 7
kwargs_dict_bp_promp['phase_generator_kwargs']['tau'] = 0.62 kwargs_dict_bp_promp['phase_generator_kwargs']['tau'] = 0.62
@ -551,7 +552,7 @@ _versions = ['ALRAntJump-v0']
for _v in _versions: for _v in _versions:
_name = _v.split("-") _name = _v.split("-")
_env_id = f'{_name[0]}ProMP-{_name[1]}' _env_id = f'{_name[0]}ProMP-{_name[1]}'
kwargs_dict_ant_jump_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_ant_jump_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_ant_jump_promp['wrappers'].append(mujoco.ant_jump.NewMPWrapper) kwargs_dict_ant_jump_promp['wrappers'].append(mujoco.ant_jump.NewMPWrapper)
kwargs_dict_ant_jump_promp['movement_primitives_kwargs']['action_dim'] = 8 kwargs_dict_ant_jump_promp['movement_primitives_kwargs']['action_dim'] = 8
kwargs_dict_ant_jump_promp['phase_generator_kwargs']['tau'] = 10 kwargs_dict_ant_jump_promp['phase_generator_kwargs']['tau'] = 10
@ -572,7 +573,7 @@ _versions = ['ALRHalfCheetahJump-v0']
for _v in _versions: for _v in _versions:
_name = _v.split("-") _name = _v.split("-")
_env_id = f'{_name[0]}ProMP-{_name[1]}' _env_id = f'{_name[0]}ProMP-{_name[1]}'
kwargs_dict_halfcheetah_jump_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_halfcheetah_jump_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_halfcheetah_jump_promp['wrappers'].append(mujoco.ant_jump.NewMPWrapper) kwargs_dict_halfcheetah_jump_promp['wrappers'].append(mujoco.ant_jump.NewMPWrapper)
kwargs_dict_halfcheetah_jump_promp['movement_primitives_kwargs']['action_dim'] = 6 kwargs_dict_halfcheetah_jump_promp['movement_primitives_kwargs']['action_dim'] = 6
kwargs_dict_halfcheetah_jump_promp['phase_generator_kwargs']['tau'] = 5 kwargs_dict_halfcheetah_jump_promp['phase_generator_kwargs']['tau'] = 5
@ -596,7 +597,7 @@ _versions = ['ALRHopperJump-v0', 'ALRHopperJumpRndmJointsDesPos-v0', 'ALRHopperJ
for _v in _versions: for _v in _versions:
_name = _v.split("-") _name = _v.split("-")
_env_id = f'{_name[0]}ProMP-{_name[1]}' _env_id = f'{_name[0]}ProMP-{_name[1]}'
kwargs_dict_hopper_jump_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_hopper_jump_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_hopper_jump_promp['wrappers'].append('TODO') # TODO kwargs_dict_hopper_jump_promp['wrappers'].append('TODO') # TODO
kwargs_dict_hopper_jump_promp['movement_primitives_kwargs']['action_dim'] = 3 kwargs_dict_hopper_jump_promp['movement_primitives_kwargs']['action_dim'] = 3
kwargs_dict_hopper_jump_promp['phase_generator_kwargs']['tau'] = 2 kwargs_dict_hopper_jump_promp['phase_generator_kwargs']['tau'] = 2
@ -618,7 +619,7 @@ _versions = ['ALRWalker2DJump-v0']
for _v in _versions: for _v in _versions:
_name = _v.split("-") _name = _v.split("-")
_env_id = f'{_name[0]}ProMP-{_name[1]}' _env_id = f'{_name[0]}ProMP-{_name[1]}'
kwargs_dict_walker2d_jump_promp = dict(DEFAULT_MP_ENV_DICT) kwargs_dict_walker2d_jump_promp = deepcopy(DEFAULT_MP_ENV_DICT)
kwargs_dict_walker2d_jump_promp['wrappers'].append('TODO') # TODO kwargs_dict_walker2d_jump_promp['wrappers'].append('TODO') # TODO
kwargs_dict_walker2d_jump_promp['movement_primitives_kwargs']['action_dim'] = 6 kwargs_dict_walker2d_jump_promp['movement_primitives_kwargs']['action_dim'] = 6
kwargs_dict_walker2d_jump_promp['phase_generator_kwargs']['tau'] = 2.4 kwargs_dict_walker2d_jump_promp['phase_generator_kwargs']['tau'] = 2.4