Skip to content

lit_sb3.utils.maskable

source module lit_sb3.utils.maskable

Functions

  • get_action_masks — Checks whether gym env exposes a method returning invalid action masks.

  • is_masking_supported — Checks whether gym env exposes a method returning invalid action masks.

source get_action_masks(env: GymEnv) → np.ndarray

Checks whether gym env exposes a method returning invalid action masks.

Parameters

  • env : GymEnv — the Gym environment to get masks from

Returns

  • np.ndarray — A numpy array of the masks

source is_masking_supported(env: GymEnv) → bool

Checks whether gym env exposes a method returning invalid action masks.

Parameters

  • env : GymEnv — the Gym environment to check

Returns

  • bool — True if the method is found, False otherwise