Skip to content

Commit 973a9d7

Browse files
williamFalconSeanNaren
authored andcommitted
updated trainer docs (#4571)
(cherry picked from commit f63fec9)
1 parent c69dcd2 commit 973a9d7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/source/new-project.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,13 @@ Here's an example adding a not-so-fancy learning rate decay rule:
608608
new_lr_group.append(new_lr)
609609
param_group['lr'] = new_lr
610610
self.old_lrs[opt_idx] = new_lr_group
611-
611+
612+
And pass the callback to the Trainer
613+
614+
.. code-block:: python
615+
616+
decay_callback = DecayLearningRate()
617+
trainer = Trainer(callbacks=[decay_callback])
612618
613619
Things you can do with a callback:
614620

0 commit comments

Comments
 (0)