_ParamScheduler — mmengine 0.10.7 documentation (original) (raw)

class mmengine.optim._ParamScheduler(optimizer, param_name, begin=0, end=1000000000, last_step=-1, by_epoch=True, verbose=False)[source]

Base class for parameter schedulers.

It should be inherited by all schedulers that schedule parameters in the optimizer’s param_groups. All subclasses should overwrite the_get_value() according to their own schedule strategy. The implementation is motivated byhttps://github.com/pytorch/pytorch/blob/master/torch/optim/lr_scheduler.py.

Parameters:

get_last_value()[source]

Return the last computed value by current scheduler.

Returns:

A list of the last computed value of the optimizer’sparam_group.

Return type:

list

load_state_dict(state_dict)[source]

Loads the schedulers state.

Parameters:

state_dict (dict) – scheduler state. Should be an object returned from a call to state_dict().

print_value(is_verbose, group, value)[source]

Display the current parameter value.

Parameters:

state_dict()[source]

Returns the state of the scheduler as a dict.

It contains an entry for every variable in self.__dict__ which is not the optimizer.

Returns:

scheduler state.

Return type:

dict

step()[source]

Adjusts the parameter value of each parameter group based on the specified schedule.