register_modality#

torch_brain.registry.register_modality(name, **kwargs)[source]#

Register a new modality specification in the global registry.

Parameters:
  • name (str) – Unique identifier for this modality

  • **kwargs (Any) – Keyword arguments used to construct the ModalitySpec Must include: dim, type, loss_fn, timestamp_key, value_key

Returns:

Unique numeric ID assigned to this modality

Return type:

int

Raises:

ValueError – If a modality with the given name already exists