neuraltrain.models.common.ChannelMerger

pydantic model neuraltrain.models.common.ChannelMerger[source][source]

Configuration for the ChannelMerger module.

Parameters:
  • embed_ref – 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 – 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 – 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

    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.

Fields:
field n_virtual_channels: int = 270[source]
field fourier_emb_config: FourierEmb = FourierEmb(n_freqs=None, total_dim=288, n_dims=2, margin=0.2)[source]
field dropout: float = 0[source]
field dropout_around_channel: bool = False[source]
field usage_penalty: float = 0.0[source]
field n_subjects: int = 200[source]
field per_subject: bool = False[source]
field embed_ref: bool = False[source]
field unmerge: bool = False[source]
field invalid_value: float = -0.1[source]
build() ChannelMergerModel[source][source]