Skip to content

lit_sb3.distributions.bernoulli

source module lit_sb3.distributions.bernoulli

Bernoulli distribution for MultiBinary action spaces.

Classes

source class BernoulliDistribution(action_dims: int)

Bases : Distribution

Bernoulli distribution for MultiBinary action spaces.

Parameters

  • action_dims : int — Number of binary actions

Methods

source method BernoulliDistribution.proba_distribution_net(latent_dim: int) → nn.Module

Create the layer that represents the distribution.

it will be the logits of the Bernoulli distribution.

Parameters

  • latent_dim : int — Dimension of the last layer of the policy network (before the action layer)

source method BernoulliDistribution.proba_distribution(action_logits: torch.Tensor) → SelfBernoulliDistribution

source method BernoulliDistribution.log_prob(actions: torch.Tensor) → torch.Tensor

source method BernoulliDistribution.entropy() → torch.Tensor

source method BernoulliDistribution.sample() → torch.Tensor

source method BernoulliDistribution.mode() → torch.Tensor

source method BernoulliDistribution.actions_from_params(action_logits: torch.Tensor, deterministic: bool = False) → torch.Tensor

source method BernoulliDistribution.log_prob_from_params(action_logits: torch.Tensor) → tuple[torch.Tensor, torch.Tensor]