ExpStateScheduler#
- class ignite.handlers.state_param_scheduler.ExpStateScheduler(initial_value, gamma, param_name, save_history=False)[source]#
Update a parameter during training by using exponential function. The function decays the parameter value by gamma every step. Based on the closed form of ExponentialLR from PyTorch https://pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.ExponentialLR.html
- Parameters
Examples
... engine = Engine(train_step) param_scheduler = ExpStateScheduler( param_name="param", initial_value=10, gamma=0.99 ) param_scheduler.attach(engine, Events.EPOCH_COMPLETED) # basic handler to print scheduled state parameter engine.add_event_handler(Events.EPOCH_COMPLETED, lambda _ : print(engine.state.param)) engine.run([0] * 8, max_epochs=2)
New in version 0.4.7.
Methods
Method to get current parameter values