braindecode.modules.SafeLog#
- class braindecode.modules.SafeLog(epsilon=1e-06)[source]#
 Safe logarithm activation function module.
:math:text{SafeLog}(x) = logleft(max(x, epsilon)right)
- Parameters:
 eps (float, optional) – A small value to clamp the input tensor to prevent computing log(0) or log of negative numbers. Default is 1e-6.
Methods
- extra_repr()[source]#
 Return the extra representation of the module.
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
- Return type:
 
- forward(x)[source]#
 Forward pass of the SafeLog module.
- Parameters:
 x (torch.Tensor) – Input tensor.
- Returns:
 Output tensor after applying safe logarithm.
- Return type: