Skip to content

common.get_activation_function

Full path: schola.scripts.common.get_activation_function

schola.scripts.common.get_activation_function

get_activation_function

get_activation_function(activation)

Get the PyTorch activation function class for the specified activation type.

Parameters

activation (ActivationFunctionEnum) : The activation function type to retrieve.

Returns

The PyTorch activation function class (not an instance).

Return type: Type[torch.nn.Module]

Raises

  • ValueError - If the activation function type is not supported.

Notes

PyTorch is imported lazily within this function to avoid import overhead when not needed in cli scripts.