added non-contextual envs

This commit is contained in:
Onur 2022-04-20 10:50:41 +02:00
parent 092525889b
commit 1c9019ab08

View File

@ -192,69 +192,150 @@ register(
} }
) )
# CtxtFree are v0, Contextual are v1
register( register(
id='ALRAntJump-v0', id='ALRAntJump-v0',
entry_point='alr_envs.alr.mujoco:ALRAntJumpEnv', entry_point='alr_envs.alr.mujoco:ALRAntJumpEnv',
max_episode_steps=MAX_EPISODE_STEPS_ANTJUMP, max_episode_steps=MAX_EPISODE_STEPS_ANTJUMP,
kwargs={ kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_ANTJUMP "max_episode_steps": MAX_EPISODE_STEPS_ANTJUMP,
"context": False
} }
) )
# CtxtFree are v0, Contextual are v1
register(
id='ALRAntJump-v1',
entry_point='alr_envs.alr.mujoco:ALRAntJumpEnv',
max_episode_steps=MAX_EPISODE_STEPS_ANTJUMP,
kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_ANTJUMP,
"context": True
}
)
# CtxtFree are v0, Contextual are v1
register( register(
id='ALRHalfCheetahJump-v0', id='ALRHalfCheetahJump-v0',
entry_point='alr_envs.alr.mujoco:ALRHalfCheetahJumpEnv', entry_point='alr_envs.alr.mujoco:ALRHalfCheetahJumpEnv',
max_episode_steps=MAX_EPISODE_STEPS_HALFCHEETAHJUMP, max_episode_steps=MAX_EPISODE_STEPS_HALFCHEETAHJUMP,
kwargs={ kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HALFCHEETAHJUMP "max_episode_steps": MAX_EPISODE_STEPS_HALFCHEETAHJUMP,
"context": False
} }
) )
# CtxtFree are v0, Contextual are v1
register(
id='ALRHalfCheetahJump-v1',
entry_point='alr_envs.alr.mujoco:ALRHalfCheetahJumpEnv',
max_episode_steps=MAX_EPISODE_STEPS_HALFCHEETAHJUMP,
kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HALFCHEETAHJUMP,
"context": True
}
)
# CtxtFree are v0, Contextual are v1
register( register(
id='ALRHopperJump-v0', id='ALRHopperJump-v0',
entry_point='alr_envs.alr.mujoco:ALRHopperJumpEnv', entry_point='alr_envs.alr.mujoco:ALRHopperJumpEnv',
max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMP, max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMP,
kwargs={ kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HOPPERJUMP "max_episode_steps": MAX_EPISODE_STEPS_HOPPERJUMP,
"context": False
} }
) )
register(
id='ALRHopperJump-v1',
entry_point='alr_envs.alr.mujoco:ALRHopperJumpEnv',
max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMP,
kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HOPPERJUMP,
"context": True
}
)
# CtxtFree are v0, Contextual are v1
register( register(
id='ALRHopperJumpOnBox-v0', id='ALRHopperJumpOnBox-v0',
entry_point='alr_envs.alr.mujoco:ALRHopperJumpOnBoxEnv', entry_point='alr_envs.alr.mujoco:ALRHopperJumpOnBoxEnv',
max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMPONBOX, max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMPONBOX,
kwargs={ kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HOPPERJUMPONBOX "max_episode_steps": MAX_EPISODE_STEPS_HOPPERJUMPONBOX,
"context": False
} }
) )
# CtxtFree are v0, Contextual are v1
register(
id='ALRHopperJumpOnBox-v1',
entry_point='alr_envs.alr.mujoco:ALRHopperJumpOnBoxEnv',
max_episode_steps=MAX_EPISODE_STEPS_HOPPERJUMPONBOX,
kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HOPPERJUMPONBOX,
"context": True
}
)
# CtxtFree are v0, Contextual are v1
register( register(
id='ALRHopperThrow-v0', id='ALRHopperThrow-v0',
entry_point='alr_envs.alr.mujoco:ALRHopperThrowEnv', entry_point='alr_envs.alr.mujoco:ALRHopperThrowEnv',
max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROW, max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROW,
kwargs={ kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HOPPERTHROW "max_episode_steps": MAX_EPISODE_STEPS_HOPPERTHROW,
"context": False
} }
) )
# CtxtFree are v0, Contextual are v1
register(
id='ALRHopperThrow-v1',
entry_point='alr_envs.alr.mujoco:ALRHopperThrowEnv',
max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROW,
kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HOPPERTHROW,
"context": True
}
)
# CtxtFree are v0, Contextual are v1
register( register(
id='ALRHopperThrowInBasket-v0', id='ALRHopperThrowInBasket-v0',
entry_point='alr_envs.alr.mujoco:ALRHopperThrowInBasketEnv', entry_point='alr_envs.alr.mujoco:ALRHopperThrowInBasketEnv',
max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROWINBASKET, max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROWINBASKET,
kwargs={ kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HOPPERTHROWINBASKET "max_episode_steps": MAX_EPISODE_STEPS_HOPPERTHROWINBASKET,
"context": False
} }
) )
# CtxtFree are v0, Contextual are v1
register(
id='ALRHopperThrowInBasket-v1',
entry_point='alr_envs.alr.mujoco:ALRHopperThrowInBasketEnv',
max_episode_steps=MAX_EPISODE_STEPS_HOPPERTHROWINBASKET,
kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_HOPPERTHROWINBASKET,
"context": True
}
)
# CtxtFree are v0, Contextual are v1
register( register(
id='ALRWalker2DJump-v0', id='ALRWalker2DJump-v0',
entry_point='alr_envs.alr.mujoco:ALRWalker2dJumpEnv', entry_point='alr_envs.alr.mujoco:ALRWalker2dJumpEnv',
max_episode_steps=MAX_EPISODE_STEPS_WALKERJUMP, max_episode_steps=MAX_EPISODE_STEPS_WALKERJUMP,
kwargs={ kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_WALKERJUMP "max_episode_steps": MAX_EPISODE_STEPS_WALKERJUMP,
"context": False
} }
) )
# CtxtFree are v0, Contextual are v1
register(
id='ALRWalker2DJump-v1',
entry_point='alr_envs.alr.mujoco:ALRWalker2dJumpEnv',
max_episode_steps=MAX_EPISODE_STEPS_WALKERJUMP,
kwargs={
"max_episode_steps": MAX_EPISODE_STEPS_WALKERJUMP,
"context": True
}
)
## Balancing Reacher ## Balancing Reacher
register( register(
@ -502,203 +583,198 @@ for _v, cd in enumerate(ctxt_dim):
) )
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id)
## AntJump ## AntJump
for _v, cd in enumerate(ctxt_dim): _versions = ["v0", "v1"]
_env_id = f'TableTennisProMP-v{_v}' for _v in _versions:
_env_id = f'ALRAntJumpProMP-{_v}'
register( register(
id=_env_id, id=_env_id,
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
kwargs={ kwargs={
"name": "alr_envs:TableTennis{}DCtxt-v0".format(cd), "name": f"alr_envs:ALRAntJump-{_v}",
"wrappers": [mujoco.table_tennis.MPWrapper], "wrappers": [mujoco.ant_jump.MPWrapper],
"mp_kwargs": { "mp_kwargs": {
"num_dof": 7, "num_dof": 8,
"num_basis": 2, "num_basis": 5,
"duration": 1.25, "duration": 10,
"post_traj_time": 1.5, "post_traj_time": 0,
"policy_type": "motor", "policy_type": "motor",
"weights_scale": 1.0, "weights_scale": 1.0,
"zero_start": True, "zero_start": True,
"zero_goal": False, "zero_goal": False,
"policy_kwargs": { "policy_kwargs": {
"p_gains": 0.5*np.array([1.0, 4.0, 2.0, 4.0, 1.0, 4.0, 1.0]), "p_gains": np.ones(8),
"d_gains": 0.5*np.array([0.1, 0.4, 0.2, 0.4, 0.1, 0.4, 0.1]) "d_gains": 0.1*np.ones(8)
} }
} }
} }
) )
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id)
## HalfCheetahJump
register( _versions = ["v0", "v1"]
id='ALRAntJumpProMP-v0', for _v in _versions:
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', _env_id = f'ALRHalfCheetahJumpProMP-{_v}'
kwargs={ register(
"name": "alr_envs:ALRAntJump-v0", id=_env_id,
"wrappers": [mujoco.ant_jump.MPWrapper], entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
"mp_kwargs": { kwargs={
"num_dof": 8, "name": f"alr_envs:ALRHalfCheetahJump-{_v}",
"num_basis": 5, "wrappers": [mujoco.half_cheetah_jump.MPWrapper],
"duration": 10, "mp_kwargs": {
"post_traj_time": 0, "num_dof": 6,
"policy_type": "motor", "num_basis": 5,
"weights_scale": 1.0, "duration": 5,
"zero_start": True, "post_traj_time": 0,
"zero_goal": False, "policy_type": "motor",
"policy_kwargs": { "weights_scale": 1.0,
"p_gains": np.ones(8), "zero_start": True,
"d_gains": 0.1*np.ones(8) "zero_goal": False,
"policy_kwargs": {
"p_gains": np.ones(6),
"d_gains": 0.1*np.ones(6)
}
} }
} }
} )
) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id)
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append('ALRAntJumpProMP-v0')
register( ## HopperJump
id='ALRHalfCheetahJumpProMP-v0', _versions = ["v0", "v1"]
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', for _v in _versions:
kwargs={ _env_id = f'ALRHopperJumpProMP-{_v}'
"name": "alr_envs:ALRHalfCheetahJump-v0", register(
"wrappers": [mujoco.half_cheetah_jump.MPWrapper], id= _env_id,
"mp_kwargs": { entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
"num_dof": 6, kwargs={
"num_basis": 5, "name": f"alr_envs:ALRHopperJump-{_v}",
"duration": 5, "wrappers": [mujoco.hopper_jump.MPWrapper],
"post_traj_time": 0, "mp_kwargs": {
"policy_type": "motor", "num_dof": 3,
"weights_scale": 1.0, "num_basis": 5,
"zero_start": True, "duration": 2,
"zero_goal": False, "post_traj_time": 0,
"policy_kwargs": { "policy_type": "motor",
"p_gains": np.ones(6), "weights_scale": 1.0,
"d_gains": 0.1*np.ones(6) "zero_start": True,
"zero_goal": False,
"policy_kwargs": {
"p_gains": np.ones(3),
"d_gains": 0.1*np.ones(3)
}
} }
} }
} )
) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id)
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append('ALRHalfCheetahJumpProMP-v0')
## HopperJumpOnBox
register( _versions = ["v0", "v1"]
id='ALRHopperJumpProMP-v0', for _v in _versions:
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', _env_id = f'ALRHopperJumpOnBoxProMP-{_v}'
kwargs={ register(
"name": "alr_envs:ALRHopperJump-v0", id=_env_id,
"wrappers": [mujoco.hopper_jump.MPWrapper], entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
"mp_kwargs": { kwargs={
"num_dof": 3, "name": f"alr_envs:ALRHopperJumpOnBox-{_v}",
"num_basis": 5, "wrappers": [mujoco.hopper_jump.MPWrapper],
"duration": 2, "mp_kwargs": {
"post_traj_time": 0, "num_dof": 3,
"policy_type": "motor", "num_basis": 5,
"weights_scale": 1.0, "duration": 2,
"zero_start": True, "post_traj_time": 0,
"zero_goal": False, "policy_type": "motor",
"policy_kwargs": { "weights_scale": 1.0,
"p_gains": np.ones(3), "zero_start": True,
"d_gains": 0.1*np.ones(3) "zero_goal": False,
"policy_kwargs": {
"p_gains": np.ones(3),
"d_gains": 0.1*np.ones(3)
}
} }
} }
} )
) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id)
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append('ALRHopperJumpProMP-v0')
register( #HopperThrow
id='ALRHopperJumpOnBoxProMP-v0', _versions = ["v0", "v1"]
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', for _v in _versions:
kwargs={ _env_id = f'ALRHopperThrowProMP-{_v}'
"name": "alr_envs:ALRHopperJumpOnBox-v0", register(
"wrappers": [mujoco.hopper_jump.MPWrapper], id=_env_id,
"mp_kwargs": { entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
"num_dof": 3, kwargs={
"num_basis": 5, "name": f"alr_envs:ALRHopperThrow-{_v}",
"duration": 2, "wrappers": [mujoco.hopper_throw.MPWrapper],
"post_traj_time": 0, "mp_kwargs": {
"policy_type": "motor", "num_dof": 3,
"weights_scale": 1.0, "num_basis": 5,
"zero_start": True, "duration": 2,
"zero_goal": False, "post_traj_time": 0,
"policy_kwargs": { "policy_type": "motor",
"p_gains": np.ones(3), "weights_scale": 1.0,
"d_gains": 0.1*np.ones(3) "zero_start": True,
"zero_goal": False,
"policy_kwargs": {
"p_gains": np.ones(3),
"d_gains": 0.1*np.ones(3)
}
} }
} }
} )
) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id)
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append('ALRHopperJumpOnBoxProMP-v0')
## HopperThrowInBasket
register( _versions = ["v0", "v1"]
id='ALRHopperThrowProMP-v0', for _v in _versions:
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', _env_id = f'ALRHopperThrowInBasketProMP-{_v}'
kwargs={ register(
"name": "alr_envs:ALRHopperThrow-v0", id=_env_id,
"wrappers": [mujoco.hopper_throw.MPWrapper], entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
"mp_kwargs": { kwargs={
"num_dof": 3, "name": f"alr_envs:ALRHopperThrowInBasket-{_v}",
"num_basis": 5, "wrappers": [mujoco.hopper_throw.MPWrapper],
"duration": 2, "mp_kwargs": {
"post_traj_time": 0, "num_dof": 3,
"policy_type": "motor", "num_basis": 5,
"weights_scale": 1.0, "duration": 2,
"zero_start": True, "post_traj_time": 0,
"zero_goal": False, "policy_type": "motor",
"policy_kwargs": { "weights_scale": 1.0,
"p_gains": np.ones(3), "zero_start": True,
"d_gains": 0.1*np.ones(3) "zero_goal": False,
"policy_kwargs": {
"p_gains": np.ones(3),
"d_gains": 0.1*np.ones(3)
}
} }
} }
} )
) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id)
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append('ALRHopperThrowProMP-v0')
## Walker2DJump
register( _versions = ["v0", "v1"]
id='ALRHopperThrowInBasketProMP-v0', for _v in _versions:
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper', _env_id = f'ALRWalker2DJumpProMP-{_v}'
kwargs={ register(
"name": "alr_envs:ALRHopperThrowInBasket-v0", id=_env_id,
"wrappers": [mujoco.hopper_throw.MPWrapper], entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
"mp_kwargs": { kwargs={
"num_dof": 3, "name": f"alr_envs:ALRWalker2DJump-{_v}",
"num_basis": 5, "wrappers": [mujoco.walker_2d_jump.MPWrapper],
"duration": 2, "mp_kwargs": {
"post_traj_time": 0, "num_dof": 6,
"policy_type": "motor", "num_basis": 5,
"weights_scale": 1.0, "duration": 2.4,
"zero_start": True, "post_traj_time": 0,
"zero_goal": False, "policy_type": "motor",
"policy_kwargs": { "weights_scale": 1.0,
"p_gains": np.ones(3), "zero_start": True,
"d_gains": 0.1*np.ones(3) "zero_goal": False,
"policy_kwargs": {
"p_gains": np.ones(6),
"d_gains": 0.1*np.ones(6)
}
} }
} }
} )
) ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append(_env_id)
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append('ALRHopperThrowInBasketProMP-v0')
register(
id='ALRWalker2DJumpProMP-v0',
entry_point='alr_envs.utils.make_env_helpers:make_promp_env_helper',
kwargs={
"name": "alr_envs:ALRWalker2DJump-v0",
"wrappers": [mujoco.walker_2d_jump.MPWrapper],
"mp_kwargs": {
"num_dof": 6,
"num_basis": 5,
"duration": 2.4,
"post_traj_time": 0,
"policy_type": "motor",
"weights_scale": 1.0,
"zero_start": True,
"zero_goal": False,
"policy_kwargs": {
"p_gains": np.ones(6),
"d_gains": 0.1*np.ones(6)
}
}
}
)
ALL_ALR_MOTION_PRIMITIVE_ENVIRONMENTS["ProMP"].append('ALRWalker2DJumpProMP-v0')