Skip to main content

utils

General helpful utilities to be found here.

Module

Functions

def one_hot_encode_list(    targets: Union[np.ndarray, Iterable[np.ndarray], Iterable[int], Iterable[Iterable[int]]],)> numpy.ndarray:

Converts a list of targets into a list of one-hot targets.

def seed_all(seed_value: Optional[int] = None)> None:

Sets random seed for numpy, python.random and any other relevant library.

If pytorch is used as the backend, this is just a wrapper around the seed_everything function from pytorch-lightning.

Arguments

  • seed_value: The seed value to use. If None, uses the default seed (42).
info

PYTHONHASHSEED is not set as an environment variable because this has no effect once the process has been started. If you wish to set this, you should set it yourself in your own environment before running python.