Skip to content

lit_sb3.distributions.squashed_gaussian

source module lit_sb3.distributions.squashed_gaussian

Squashed (tanh) diagonal Gaussian distribution.

Classes

source class SquashedDiagGaussianDistribution(action_dim: int, epsilon: float = 1e-06)

Bases : DiagGaussianDistribution

Gaussian distribution with diagonal covariance matrix, followed by a squashing function (tanh) to ensure bounds.

Parameters

  • action_dim : int — Dimension of the action space.

  • epsilon : float — small value to avoid NaN due to numerical imprecision.

Methods

source method SquashedDiagGaussianDistribution.proba_distribution(mean_actions: torch.Tensor, log_std: torch.Tensor) → SelfSquashedDiagGaussianDistribution

source method SquashedDiagGaussianDistribution.log_prob(actions: torch.Tensor, gaussian_actions: torch.Tensor | None = None) → torch.Tensor

source method SquashedDiagGaussianDistribution.entropy() → torch.Tensor | None

source method SquashedDiagGaussianDistribution.sample() → torch.Tensor

source method SquashedDiagGaussianDistribution.mode() → torch.Tensor

source method SquashedDiagGaussianDistribution.log_prob_from_params(mean_actions: torch.Tensor, log_std: torch.Tensor) → tuple[torch.Tensor, torch.Tensor]