neuraltrain.models.luna.NtLuna¶
- pydantic model neuraltrain.models.luna.NtLuna[source][source]¶
Config for the braindecode LUNA model.
Extends
BaseBrainDecodeModelwith LUNA-specific logic:Keyword mapping — wraps the model so its forward accepts
channel_positionsand maps it to LUNA’schannel_locations.Time padding — zero-pads the time dimension to a multiple of
patch_size.Encoder-only output — when
n_outputsis not passed (i.e. when aDownstreamWrapperModelhandles the classification head), the classification head is replaced withnn.Identity()so the model returns the encoder latent.
- Parameters:
pretrained_filename (str or None) – When
from_pretrained_namepoints 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 thefilenamekwarg infrom_pretrained.- Fields:
- build(n_spatial_locations: int, n_temporal_samples: int, n_outputs: int | None = None, chs_info: list[dict[str, Any]] | None = None, frequency: float | None = None) Module[source][source]¶
Build the braindecode model from context-named shape parameters.
Parameters are named/typed like
BrainModelBuildContextfields/properties, so the basebuild_from_contextinjects them (chs_info/frequencyfrom the matching context properties/fields). Covers every auto-registered braindecode model (EEGNet, Deep4Net, ShallowFBCSPNet, BIOT, …); custom configs (LaBraM, REVE, LUNA, BENDR) override this and reuse_bd_shape_kwargs()for the name mapping.