Skip to content

SquashedNormal

source



Squashed normal 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()


Return the transformed mean.

.mode

source

.mode()


Returns the mode of the distribution.

.log_prob

source

.log_prob(
   actions: th.Tensor
)


Scores the sample by inverting the transform(s) and computing the score using the score of the base distribution and the log abs det jacobian.

Args

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

Returns

The log_prob value.