Environments

EnvironmentInfo

class nnabla_rl.environments.environment_info.EnvironmentInfo(observation_space: gym.spaces.space.Space, action_space: gym.spaces.space.Space, max_episode_steps: int)[source]

Environment Information class

This class contains the basic information of the target training environment.

property action_dim

The dimension of action assuming that the action is flatten.

property action_shape

The shape of action space

static from_env(env)[source]

Create env_info from environment

Parameters

env (gym.Env) – the environment

Returns

EnvironmentInfo (EnvironmentInfo)

Example

>>> import gym
>>> from nnabla_rl.environments.environment_info import EnvironmentInfo
>>> env = gym.make("CartPole-v0")
>>> env_info = EnvironmentInfo.from_env(env)
>>> env_info.state_shape
(4,)
is_continuous_action_env()[source]

Check whether the action to execute in the environment is continuous or not

Returns

True if the action to execute in the environment is continuous. Otherwise False.

Return type

bool

is_discrete_action_env()[source]

Check whether the action to execute in the environment is discrete or not

Returns

True if the action to execute in the environment is discrete. Otherwise False.

Return type

bool

property state_dim

The dimension of state assuming that the state is flatten.

property state_shape

The shape of observation space