updated trainer docs (#4571)

This commit is contained in:
William Falcon 2020-11-07 15:41:02 -05:00 committed by GitHub
parent e0bdf8124b
commit f63fec9323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -608,7 +608,13 @@ Here's an example adding a not-so-fancy learning rate decay rule:
new_lr_group.append(new_lr)
param_group['lr'] = new_lr
self.old_lrs[opt_idx] = new_lr_group
And pass the callback to the Trainer
.. code-block:: python
decay_callback = DecayLearningRate()
trainer = Trainer(callbacks=[decay_callback])
Things you can do with a callback: