neuraltrain.models.luna.NtLuna

class neuraltrain.models.luna.NtLuna(*, kwargs: dict[str, Any] = {}, from_pretrained_name: str | None = None, pretrained_filename: str | None = None)[source][source]

Config for the braindecode LUNA model.

Extends BaseBrainDecodeModel with LUNA-specific logic:

  1. Keyword mapping — wraps the model so its forward accepts channel_positions and maps it to LUNA’s channel_locations.

  2. Time padding — zero-pads the time dimension to a multiple of patch_size.

  3. Encoder-only output — when n_outputs is not passed (i.e. when a DownstreamWrapperModel handles the classification head), the classification head is replaced with nn.Identity() so the model returns the encoder latent.

Parameters:

pretrained_filename (str or None) – When from_pretrained_name points to a Hub repository containing multiple weight files (e.g. PulpBio/LUNA), this selects which file to download. Requires braindecode >= 1.5 which natively supports the filename kwarg in from_pretrained.