braindecode.modules.TimmMlp#
- class braindecode.modules.TimmMlp(in_features, hidden_features=None, out_features=None, act_layer=<class 'torch.nn.modules.activation.GELU'>, drop=0.0)[source]#
Two-layer MLP with timm’s parameter names (
fc1,act,fc2,drop), as in ViT/MAE checkpoints: dropout after the activation and after the second layer. EEGPT and LUNA use it, so their released weights load with the same keys.- Parameters:
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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.