bettermdptools.seed API documentation

# bettermdptools.seed

View Source

     1import os
     2import random
     3
     4import numpy as np
     5from gymnasium.utils import seeding
     6
     7SEED = None
     8
     9
    10def set_seed(seed: int) -> None:
    11    """
    12    Set the seed for reproducibility.
    13
    14    Parameters
    15    ----------
    16    seed : int
    17        The seed value to set.
    18
    19    Returns
    20    -------
    21    None
    22    """
    23    global SEED
    24    SEED = seed
    25    os.environ["PYTHONHASHSEED"] = str(SEED)
    26    random.seed(SEED)
    27    np.random.seed(SEED)
    28    seeding.np_random(SEED)

SEED = None
def set_seed(seed: int) -> None: View Source

    11def set_seed(seed: int) -> None:
    12    """
    13    Set the seed for reproducibility.
    14
    15    Parameters
    16    ----------
    17    seed : int
    18        The seed value to set.
    19
    20    Returns
    21    -------
    22    None
    23    """
    24    global SEED
    25    SEED = seed
    26    os.environ["PYTHONHASHSEED"] = str(SEED)
    27    random.seed(SEED)
    28    np.random.seed(SEED)
    29    seeding.np_random(SEED)

Set the seed for reproducibility.

###### Parameters

- seed (int): The seed value to set.

###### Returns

- None