hyrax.models.model_registry
Attributes
Functions
|
|
|
|
|
Load the criterion class using the name defined in the config and |
|
Load the optimizer class using the name defined in the config and |
|
Decorator to register a model with the model registry, and to add common interface functions |
|
Fetch the model class from the model registry. |
Module Contents
- _torch_criterion(self: torch.nn.Module)[source]
Load the criterion class using the name defined in the config and instantiate it with the arguments defined in the config.
- _torch_optimizer(self: torch.nn.Module)[source]
Load the optimizer class using the name defined in the config and instantiate it with the arguments defined in the config.
- hyrax_model(cls)[source]
Decorator to register a model with the model registry, and to add common interface functions
- Returns:
The class with additional interface functions.
- Return type:
type
- fetch_model_class(runtime_config: dict) type[torch.nn.Module][source]
Fetch the model class from the model registry.
- Parameters:
runtime_config (dict) – The runtime configuration dictionary.
- Returns:
The model class.
- Return type:
type
- Raises:
ValueError – If a built in model was requested, but not found in the model registry.
ValueError – If no model was specified in the runtime configuration.