nn.many_to_many_rnn.get_activation(name)
Return the activation module for a spotPython act_fn level name.
Parameters
| name |
str |
Activation name. Options: - “Sigmoid” - “Tanh” - “ReLU” - “LeakyReLU”: negative slope 0.1, matching spotPython. - “ELU” - “Swish”: implemented as nn.SiLU. |
required |
Returns
|
nn.Module |
nn.Module: A fresh activation module instance. |
Raises
|
ValueError |
If name is not a supported activation name. |
Examples
from spotoptim.nn.many_to_many_rnn import get_activation
act = get_activation("LeakyReLU")
print(type(act).__name__, act.negative_slope)