Rate this Page
★ ★ ★ ★ ★

TruncatedStandardNormal#

class tensordict.nn.distributions.truncated_normal.TruncatedStandardNormal(a: Number | Tensor, b: Number | Tensor, validate_args: bool | None = None)#

Bases: Distribution

Truncated Standard Normal distribution.

Source: https://people.sc.fsu.edu/~jburkardt/presentations/truncated_normal.pdf

cdf(value: Tensor) → Tensor#

Returns the cumulative density/mass function evaluated at value.

Parameters:

value (Tensor) –

entropy() → Tensor#

Returns entropy of distribution, batched over batch_shape.

Returns:

Tensor of shape batch_shape.

icdf(value: Tensor) → Tensor#

Returns the inverse cumulative density/mass function evaluated at value.

Parameters:

value (Tensor) –

log_prob(value: Tensor) → Tensor#

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

Parameters:

value (Tensor) –

property mean: Tensor#

Returns the mean of the distribution.

rsample(sample_shape: Sequence[int] | Size | None = None) → Tensor#

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

property support: constraints.Constraints#

Returns a Constraint object representing this distribution’s support.

property variance: Tensor#

Returns the variance of the distribution.