Activation

class aixd.mlmodel.architecture.blocks.Activation(*args: Any, **kwargs: Any)[source]

Bases: Module

Module wrapping around an activation function. It allows the user to specify an activation function as a string or as a PyTorch module. If a string is provided, the Activation class will initialize the corresponding PyTorch module. If a PyTorch module is provided, the Activation class will simply use that module as the activation function.

Parameters:

activation (Union[nn.Module, str]) – The activation function to use. This can be specified as a string representing one of the following activation functions: ‘linear’, ‘relu’, ‘leaky_relu’, ‘swish’, ‘elu’, ‘sigmoid’, ‘tanh’, ‘softmax’, ‘log_softmax’. Alternatively, a PyTorch activation module can be provided directly.

Methods