lit_sb3.envs.identity_env
source module lit_sb3.envs.identity_env
Classes
-
IdentityEnv — Identity environment for testing purposes.
-
IdentityEnvBox — Identity environment for testing purposes.
-
IdentityEnvMultiDiscrete — Identity environment for testing purposes.
-
IdentityEnvMultiBinary — Identity environment for testing purposes.
-
FakeImageEnv — Fake image environment for testing purposes, it mimics Atari games.
source class IdentityEnv[T: (int, np.ndarray)](dim: int | None = None, space: spaces.Space | None = None, ep_length: int = 100)
Bases : gym.Env
Identity environment for testing purposes.
Parameters
-
dim : int | None — the size of the action and observation dimension you want to learn. Provide at most one of
dimandspace. If both are None, then initialization proceeds withdim=1andspace=None. -
space : spaces.Space | None — the action and observation space. Provide at most one of
dimandspace. -
ep_length : int — the length of each episode in timesteps
Attributes
-
unwrapped : Env[ObsType, ActType] — Returns the base non-wrapped environment.
-
np_random_seed : int — attr:
_np_random_seedthat if not set will first initialise with a random int as seed. -
np_random : np.random.Generator — attr:
_np_randomthat if not set will initialise with a random seed.
Methods
source method IdentityEnv.reset(*, seed: int | None = None, options: dict | None = None) → tuple[T, dict]
source method IdentityEnv.step(action: T) → tuple[T, float, bool, bool, dict[str, Any]]
source method IdentityEnv.render(mode: str = 'human') → None
source class IdentityEnvBox(low: float = -1.0, high: float = 1.0, eps: float = 0.05, ep_length: int = 100)
Bases : IdentityEnv[np.ndarray]
Identity environment for testing purposes.
Parameters
-
low : float — the lower bound of the box dim
-
high : float — the upper bound of the box dim
-
eps : float — the epsilon bound for correct value
-
ep_length : int — the length of each episode in timesteps
Attributes
-
unwrapped : Env[ObsType, ActType] — Returns the base non-wrapped environment.
-
np_random_seed : int — attr:
_np_random_seedthat if not set will first initialise with a random int as seed. -
np_random : np.random.Generator — attr:
_np_randomthat if not set will initialise with a random seed.
Methods
source method IdentityEnvBox.step(action: np.ndarray) → tuple[np.ndarray, float, bool, bool, dict[str, Any]]
source class IdentityEnvMultiDiscrete(dim: int = 1, ep_length: int = 100)
Bases : IdentityEnv[np.ndarray]
Identity environment for testing purposes.
Parameters
-
dim : int — the size of the dimensions you want to learn
-
ep_length : int — the length of each episode in timesteps
Attributes
-
unwrapped : Env[ObsType, ActType] — Returns the base non-wrapped environment.
-
np_random_seed : int — attr:
_np_random_seedthat if not set will first initialise with a random int as seed. -
np_random : np.random.Generator — attr:
_np_randomthat if not set will initialise with a random seed.
source class IdentityEnvMultiBinary(dim: int = 1, ep_length: int = 100)
Bases : IdentityEnv[np.ndarray]
Identity environment for testing purposes.
Parameters
-
dim : int — the size of the dimensions you want to learn
-
ep_length : int — the length of each episode in timesteps
Attributes
-
unwrapped : Env[ObsType, ActType] — Returns the base non-wrapped environment.
-
np_random_seed : int — attr:
_np_random_seedthat if not set will first initialise with a random int as seed. -
np_random : np.random.Generator — attr:
_np_randomthat if not set will initialise with a random seed.
source class FakeImageEnv(action_dim: int = 6, screen_height: int = 84, screen_width: int = 84, n_channels: int = 1, discrete: bool = True, channel_first: bool = False)
Bases : gym.Env
Fake image environment for testing purposes, it mimics Atari games.
Parameters
-
action_dim : int — Number of discrete actions
-
screen_height : int — Height of the image
-
screen_width : int — Width of the image
-
n_channels : int — Number of color channels
-
discrete : bool — Create discrete action space instead of continuous
-
channel_first : bool — Put channels on first axis instead of last
Attributes
-
unwrapped : Env[ObsType, ActType] — Returns the base non-wrapped environment.
-
np_random_seed : int — attr:
_np_random_seedthat if not set will first initialise with a random int as seed. -
np_random : np.random.Generator — attr:
_np_randomthat if not set will initialise with a random seed.
Methods
source method FakeImageEnv.reset(*, seed: int | None = None, options: dict | None = None) → tuple[np.ndarray, dict]
source method FakeImageEnv.step(action: np.ndarray | int) → GymStepReturn
source method FakeImageEnv.render(mode: str = 'human') → None