Skip to content

Commit b88ef35

Browse files
committed
updated trainer docs
1 parent e0bdf81 commit b88ef35

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)