neuraltrain.models.base.BaseBrainDecodeModel

pydantic model neuraltrain.models.base.BaseBrainDecodeModel[source][source]

Base class for braindecode model configurations.

Subclasses set _MODEL_CLASS_PATH (e.g. "braindecode.models.Labram") to resolve the underlying class lazily, avoiding an unconditional braindecode import at module load time. Subclasses that need custom resolution (e.g. optional-dependency handling) can instead override _ensure_model_class directly.

The dynamic registration in _register_braindecode_models() sets _MODEL_CLASS directly at import time for the common braindecode models, which short-circuits the lazy path.

kwargs[source]

Free-form keyword arguments forwarded to the braindecode model constructor. Validated against the model’s __init__ signature at config creation time.

Type:

dict

from_pretrained_name[source]

Optional HuggingFace Hub repository ID (e.g. "braindecode/labram-pretrained"). When set, build() calls _MODEL_CLASS.from_pretrained() instead of the regular constructor.

Type:

str or None

Fields:
field kwargs: dict[str, Any] = {}[source]
field from_pretrained_name: str | None = None[source]
build(**kwargs: Any) Module[source][source]