noether.core.factory.optimizer¶
Classes¶
Factory for creating optimizers. Handles wrapping into |
Module Contents¶
- class noether.core.factory.optimizer.OptimizerFactory¶
Bases:
noether.core.factory.base.FactoryFactory for creating optimizers. Handles wrapping into
OptimizerWrapperby creating the corresponding constructor for the underlyingtorch.optim.Optimizer. Objects are returned as partials, as creating the optimizer requires the model parameters from the instantiated model.- instantiate(optimizer_config)¶
Instantiates the optimizer based on the provided configuration.
- Parameters:
optimizer_config (noether.core.schemas.optimizers.OptimizerConfig) – Configuration for the optimizer to create. This config contains both the
torch.optim.Optimizerand theOptimizerWrapperconfigurations.Optimizerand theOptimizerWrapperconfigurations. SeeOptimizerConfigfor available options.- Returns:
A callable that initializes the
OptimizerWrapper.- Return type:
collections.abc.Callable[Ellipsis, noether.core.optimizer.OptimizerWrapper]