neuraltrain.models.common.ChannelMerger¶
- class neuraltrain.models.common.ChannelMerger(*, n_virtual_channels: int = 270, fourier_emb_config: FourierEmb = FourierEmb(n_freqs=None, total_dim=288, n_dims=2, margin=0.2), dropout: float = 0, dropout_around_channel: bool = False, usage_penalty: float = 0.0, n_subjects: int = 200, per_subject: bool = False, embed_ref: bool = False, unmerge: bool = False, invalid_value: float = -0.1)[source][source]¶
Configuration for the ChannelMerger module.
- Parameters:
embed_ref (bool) – Also embed the reference position, e.g. to enable handling bipolar channels. This requires passing both positions and ref_positions to forward().
dropout_around_channel (bool) – If True, randomly sample a channel to apply dropout around. If False, randomly sample a point in [0, 1] ^ D, where D is the number of dimensions (2 or 3), around which to apply dropout.
unmerge (bool) – If True, unmerge (rather than merge) channels. This is useful to compute the inverse operation of a default ChannelMerger. In this case, the input to forward() should be of shape (B, n_virtual_channels, T).
invalid_value (float) –
If all position dimensions for a channel are equal to invalid_value, the channel will be masked out. This is useful when examples within a batch contain different channels and therefore some channels need to be ignored for some of the examples.
NOTE: ns.extractors.ChannelPositions defines this value as well.