Skip to content

DiagonalGaussian

source



Diagonal Gaussian distribution for 'Box' tasks.

Methods:

.sample

source

.sample(
   sample_shape: th.Size = th.Size()
)


Generates a sample_shape shaped sample or sample_shape shaped batch of samples if the distribution parameters are batched.

Args

  • sample_shape (th.Size) : The size of the sample to be drawn.

Returns

A sample_shape shaped sample.

.rsample

source

.rsample(
   sample_shape: th.Size = th.Size()
)


Generates a sample_shape shaped reparameterized sample or sample_shape shaped batch of reparameterized samples if the distribution parameters are batched.

Args

  • sample_shape (th.Size) : The size of the sample to be drawn.

Returns

A sample_shape shaped sample.

.mean

source

.mean()


Returns the mean of the distribution.

.mode

source

.mode()


Returns the mode of the distribution.

.stddev

source

.stddev()


Returns the standard deviation of the distribution.

.variance

source

.variance()


Returns the variance of the distribution.

.log_prob

source

.log_prob(
   actions: th.Tensor
)


Returns the log of the probability density/mass function evaluated at actions.

Args

  • actions (th.Tensor) : The actions to be evaluated.

Returns

The log_prob value.

.entropy

source

.entropy()


Returns the Shannon entropy of distribution.