braindecode.modules.LogActivation#

class braindecode.modules.LogActivation(epsilon=1e-06, *args, **kwargs)[source]#

Logarithm activation function.

Parameters:

epsilon (float, default=1e-6) – Small float to adjust the activation.

Examples

>>> import torch
>>> from braindecode.modules import LogActivation
>>> module = LogActivation(epsilon=1e-6)
>>> inputs = torch.rand(2, 3)
>>> outputs = module(inputs)
>>> outputs.shape
torch.Size([2, 3])

Methods

forward(x)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor