neuraltrain.models.conv_transformer.ConvTransformerModel¶
- class neuraltrain.models.conv_transformer.ConvTransformerModel(in_channels: int, out_channels: int | None, config: ConvTransformer)[source][source]¶
nn.Moduleimplementation ofConvTransformer.- forward(x: Tensor, subject_ids: Tensor | None = None, channel_positions: Tensor | None = None, neuro_device_type: str | None = None) dict[str, Tensor][source][source]¶
Forward pass through encoder, optional transformer, and output layer.
- 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).neuro_device_type (str or None) – Name of device represented in the batch (e.g.
"Eeg","Meg"). IfNone, the device embedding is not applied.