Optimizer#
- class Optimizer(params, defaults)[source]#
Base class for all optimizers.
- Parameters:
- add_param_group(param_group)[source]#
Add a param group to
param_groups
of theOptimizer
.This can be useful when fine tuning a pre-trained network as frozen layers can be made trainable and added to the
Optimizer
as training progresses.- Parameters:
param_group (
dict
) – specifies what tensors should be optimized along with group.
- load_state_dict(state)[source]#
Loads the optimizer state.
- Parameters:
state (
dict
) – optimizer state. Should be an object returned from a call tostate_dict
.
- state_dict(keep_var=False)[source]#
Export the optimizer state.
- Return type:
- Returns:
optimizer state. Can be loaded by
load_state_dict
.