MazeSeeding

class maze.core.utils.seeding.MazeSeeding(env_seed: int, agent_seed: int, cudnn_determinism_flag: bool, explicit_env_seeds: Union[Sequence[Any], None, Mapping[str, Any], Any], explicit_agent_seeds: Union[Sequence[Any], None, Mapping[str, Any], Any], shuffle_seeds: bool)

Manages the random seeding for maze. This class holds random state used for sampling random seed for the envs and agents.

Parameters
  • env_seed – The base_seed to be used for the envs random number generator.

  • agent_seed – The base_seed to be used for the agents random number generator.

  • cudnn_determinism_flag – Specify whether to set the cudnn determinism flag, this will ensure guaranty when working on the gpu, however some torch modules will raise runtime errors, and the processing speed will be decreased. For more information on this topic please refer to: https://pytorch.org/docs/1.7.1/notes/randomness.html?highlight=reproducability

generate_agent_instance_seed()int

Generate agent instance seed for seeding a particular instance of the agent.

Returns

A random seed for creating the agent.

generate_env_instance_seed()int

Generate env instance seed for seeding a particular instance of the env.

Returns

A random seed for creating the env.

static generate_seed_from_random_state(rng: numpy.random.RandomState)int

Method for generating a random seed from the given random number generator.

Returns

Random seed.

get_agent_base_seed()int

Return the agent base seed.

Returns

The agent base seed.

get_env_base_seed()int

Return the env base seed.

Returns

The env base seed.

get_explicit_agent_seeds(n_seeds: int) → List[Any]

Return a list of explicit agent seeds to be used for each episode.

Parameters

n_seeds – The number of seeds to be returned.

Returns

A list of seeds.

get_explicit_env_seeds(n_seeds: int) → List[Any]

Return a list of explicit env seeds to be used for each episode.

Parameters

n_seeds – The number of seeds to be returned.

Returns

A list of seeds.