rldurham.seed_everything
- rldurham.seed_everything(seed=None, env=None, seed_env=True, seed_actions=True, other=(), workers=False)[source]
This uses the PyTorch Lightning
seed_everythingmethod to seed pseudo-random number generators in pytorch, numpy, and python.random. Ifenvis provided, it optionally resets the environment and seeds its action space with the same seed.- Parameters:
seed (
Optional[int]) – integer value, seeseed_everythingdocumentation for detailsenv (
Optional[Env]) –gymnasiumenvironmentseed_env (
bool) – whether to reset/seedenv(this is done by callingreset(seed=seed))seed_actions (
bool) – whether to seed the action space ofenvother (
Iterable) – other objectsxto callx.seed(seed)onworkers (
bool) – passed on toseed_everything
- Return type:
Union[int,tuple]- Returns:
(seed, observation, info)ifenvwas reset, otherwise, justseed