- class ActivationFromFnName(activation_fn: str)[source]¶
Simple module constructed from function name to be used in nn.Sequential
Construct a nn.Module that applies the specified activation function to inputs
activation_fn – Name of the activation function to apply to input. Must be an attribute of torch.nn.functional.
- forward(inputs: Tensor) Tensor [source]¶
Defines the computation performed at every call.
Should be overridden by all subclasses.
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool¶