ocl.optimization
Convenience functions that allow defining optimization via config.
OptimizationWrapper
Optimize (a subset of) the parameters using a optimizer and a LR scheduler.
Source code in ocl/optimization.py
__init__
Initialize OptimizationWrapper.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
optimizer |
Optimizer
|
The oprimizer that should be used to optimize the parameters. |
required |
lr_scheduler |
Optional[Callable[[Optimizer], Dict[str, Any]]]
|
The LR scheduling callable that should be used. This should be a callable that returns a dict for updating the optimizer output in pytorch_lightning. See ocl.scheduling.exponential_decay_with_optional_warmup for an example of such a callable. |
None
|
parameter_groups |
Optional[List[Dict[str, Any]]]
|
Define parameter groups which have different optimizer parameters.
Each element of the list should at least one of two keys |
None
|
Source code in ocl/optimization.py
__call__
Called in configure optimizers.