braindecode.modules.EncNet#

class braindecode.modules.EncNet(in_channels, n_codewords)[source]#

Context Encoding for Semantic Segmentation from [Zhang2018].

Parameters:
  • in_channels (int) – number of input feature channels

  • n_codewords (int) – number of codewords

Examples

>>> import torch
>>> from braindecode.modules import EncNet
>>> module = EncNet(in_channels=16, n_codewords=8)
>>> inputs = torch.randn(2, 16, 1, 64)
>>> outputs = module(inputs)
>>> outputs.shape
torch.Size([2, 16, 1, 64])

References

[Zhang2018]

Zhang, H. et al. 2018. Context Encoding for Semantic Segmentation. CVPR 2018.

Methods

forward(x)[source]#

Apply attention from the Context Encoding for Semantic Segmentation.

Parameters:

x (Pytorch.Tensor)

Return type:

Pytorch.Tensor