neuraltrain.models.simplerconv.SimplerConvModel¶
- class neuraltrain.models.simplerconv.SimplerConvModel(in_channels: int, out_channels: int | None, config: SimplerConv | None = None)[source][source]¶
Convolutional encoder inspired from BENDR/wav2vec2.0, with channel attention.
- forward(x: Tensor, subject_ids: Tensor | None = None, channel_positions: Tensor | None = None) Tensor[source][source]¶
Run the convolutional encoder.
- Parameters:
x (Tensor) – Input of shape
(B, C, T).subject_ids (Tensor or None) – Per-example subject indices, shape
(B,).channel_positions (Tensor or None) – Normalised electrode coordinates, shape
(B, C, D).
- property receptive_field: int[source]¶
Compute the receptive field of the encoder. See https://distill.pub/2019/computing-receptive-fields/, Eq. 2