Skip to content

lit_sb3.vec_env.vec_check_nan

source module lit_sb3.vec_env.vec_check_nan

Classes

  • VecCheckNan — NaN and inf checking wrapper for vectorized environment, will raise a warning by default,.

source class VecCheckNan(venv: VecEnv, raise_exception: bool = False, warn_once: bool = True, check_inf: bool = True)

Bases : VecEnvWrapper

NaN and inf checking wrapper for vectorized environment, will raise a warning by default,.

allowing you to know from what the NaN of inf originated from.

Parameters

  • venv : VecEnv — the vectorized environment to wrap

  • raise_exception : bool — Whether to raise a ValueError, instead of a UserWarning

  • warn_once : bool — Whether to only warn once.

  • check_inf : bool — Whether to check for +inf or -inf as well

Methods

source method VecCheckNan.step_async(actions: np.ndarray) → None

source method VecCheckNan.step_wait() → VecEnvStepReturn

source method VecCheckNan.reset() → VecEnvObs

source method VecCheckNan.check_array_value(name: str, value: np.ndarray) → list[tuple[str, str]]

Check for inf and NaN for a single numpy array.

Parameters

  • name : str — Name of the value being check

  • value : np.ndarray — Value (numpy array) to check

Returns

  • list[tuple[str, str]] — A list of issues found.