MazeSeeding

class maze.core.utils.seeding.MazeSeeding(env_seed: int, agent_seed: int, cudnn_determinism_flag: 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.