Custom Activation Functions

Parameters

class agilerl.networks.custom_components.GumbelSoftmax(*args, **kwargs)

Applies gumbel softmax function element-wise

forward(input: Tensor) Tensor

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

static gumbel_softmax(logits, tau=1.0, eps=1e-20)

Implementation of the gumbel softmax activation function

Parameters:
  • logits (torch.Tensor) – Tensor containing unnormalized log probabilities for each class.

  • tau (float, optional) – Tau, defaults to 1.0

  • eps (float, optional) – Epsilon, defaults to 1e-20