evorl.envs.wrappers.action_wrapper¶
Module Contents¶
Classes¶
Repeat action for a number of steps. |
|
Convert continuous action space from [-1, 1] to [low, high]. |
API¶
- class evorl.envs.wrappers.action_wrapper.ActionRepeatWrapper(env: evorl.envs.env.Env, action_repeat: int)[source]¶
Bases:
evorl.envs.wrappers.wrapper.WrapperRepeat action for a number of steps.
Note
This wrapper only accumulates
state.rewardandstate.info.ori_reward. It is safe to useActionRepeatWrapper(RewardScaleWrapper(EpisodeWrapper(env))). However, if you want accumulate other metrics, inherit this class and add your own logic.Caution
When using rollout functions like
rollout,eval_rollout_episodewithrollout_lengthargument, users should usemath.ceil(env.max_episode_steps/action_repeat)to match the real rollout_length.- step(state: evorl.envs.env.EnvState, action: evorl.types.Action) evorl.envs.env.EnvState[source]¶
- class evorl.envs.wrappers.action_wrapper.ActionSquashWrapper(env: evorl.envs.env.Env)[source]¶
Bases:
evorl.envs.wrappers.wrapper.WrapperConvert continuous action space from [-1, 1] to [low, high].
- property action_space: evorl.envs.space.Space¶
- step(state: evorl.envs.env.EnvState, action: evorl.types.Action) evorl.envs.env.EnvState[source]¶