Skip to content

allenact.base_abstractions.distributions#

[view_source]

Distr#

class Distr(abc.ABC)

[view_source]

Distr.log_prob#

 | @abc.abstractmethod
 | log_prob(actions: Any)

[view_source]

Return the log probability/ies of the provided action/s.

Distr.entropy#

 | @abc.abstractmethod
 | entropy()

[view_source]

Return the entropy or entropies.

Distr.sample#

 | @abc.abstractmethod
 | sample(sample_shape=torch.Size())

[view_source]

Sample actions.

Distr.mode#

 | mode()

[view_source]

If available, return the action(s) with highest probability.

It will only be called if using deterministic agents.

CategoricalDistr#

class CategoricalDistr(torch.distributions.Categorical,  Distr)

[view_source]

A categorical distribution extending PyTorch's Categorical.

probs or logits are assumed to be passed with step and sampler dimensions as in: [step, samplers, ...]

AddBias#

class AddBias(nn.Module)

[view_source]

Adding bias parameters to input values.

AddBias.__init__#

 | __init__(bias: torch.FloatTensor)

[view_source]

Initializer.

Parameters

  • bias : data to use as the initial values of the bias.

AddBias.forward#

 | forward(x: torch.FloatTensor) -> torch.FloatTensor

[view_source]

Adds the stored bias parameters to x.