torch_brain.registry¶
Enum defining possible data types for modalities. |
|
Specification class for defining modalities. |
|
Register a new modality specification in the global registry. |
|
Get a modality specification by its ID. |
- class DataType(value)[source]¶
Enum defining the possible data types.
- CONTINUOUS¶
For continuous-valued variables
- BINARY¶
For binary variables
- MULTINOMIAL¶
For multi-class variables
- MULTILABEL¶
For multi-label variables
- CONTINUOUS = 0¶
- BINARY = 1¶
- MULTINOMIAL = 2¶
- MULTILABEL = 3¶
- class ModalitySpec(*args, **kwargs)[source]¶
Specification for a modality.
- dim¶
Dimension for this modality
- type¶
DataType enum specifying the data type
- loss_fn¶
Name of loss function to use for this modality
- timestamp_key¶
Key to access timestamps in the data object
- value_key¶
Key to access values in the data object
- id¶
Unique numeric ID assigned to this modality
- register_modality(name, **kwargs)[source]¶
Register a new modality specification in the global registry.
- Parameters:
- Returns:
Unique numeric ID assigned to this modality
- Return type:
- Raises:
ValueError – If a modality with the given name already exists