starling.data.distributions.DiagonalGaussianDistribution

class DiagonalGaussianDistribution[source]

Bases: object

Methods

__init__

Diagonal Gaussian distribution that can be used for sampling from given certain parameters.

kl

mode

Return the mode of the distribution.

nll

sample

Sample from the parameterized distribution.

__init__(parameters: Tensor, deterministic: bool = False)[source]

Diagonal Gaussian distribution that can be used for sampling from given certain parameters.

Parameters:
  • parameters (torch.Tensor) – Parameters of the distribution.

  • deterministic (bool, optional) – Whether to sample deterministically, by default False

sample() Tensor[source]

Sample from the parameterized distribution.

Returns:

The sampled value.

Return type:

torch.Tensor

kl(other=None)[source]
nll(sample, dims=[1, 2, 3])[source]
mode() Tensor[source]

Return the mode of the distribution.

Returns:

Mode of the distribution.

Return type:

torch.Tensor