helios.optim.utils¶
Attributes¶
Global instance of the registry for optimizers. |
Functions¶
|
Create the optimizer for the given type. |
Module Contents¶
- helios.optim.utils.OPTIMIZER_REGISTRY¶
Global instance of the registry for optimizers.
By default, the registry contains the following optimizers:
Optimizers¶ Optimizer
Name
torch.optim.AdadeltaAdadelta
torch.optim.AdagradAdagrad
torch.optim.AdamAdam
torch.optim.AdamWAdamW
torch.optim.SparseAdamSparseAdam
torch.optim.AdamaxAdamax
torch.optim.ASGDASGD
torch.optim.LBFGSLBFGS
torch.optim.NAdamNAdam
torch.optim.RAdamRAdam
torch.optim.RMSpropRMSprop
torch.optim.RpropRprop
torch.optim.SGDSGD
Example
import helios.optim as hlo # This automatically registers your optimizer. @hlo.OPTIMIZER_REGISTRY.register class MyOptimizer: ... # Alternatively you can manually register a optimizer like this: hlo.OPTIMIZER_REGISTRY.register(MyOptimizer)
- helios.optim.utils.create_optimizer(type_name: str, *args: Any, **kwargs: Any) torch.optim.Optimizer[source]¶
Create the optimizer for the given type.
- Parameters:
type_name – the type of the optimizer to create.
args – positional arguments to pass into the optimizer.
kwargs – keyword arguments to pass into the optimizer.
- Returns:
The optimizer.