Skip to content

Commit 533531f

Browse files
edwardleardibrianjoholly1238
authored
Update ptcheat.rst (#1083)
scheduler.step() should not be called at the start of every epoch as of PyTorch 1.1.0. Instead it should be called after the optimizer has updated the weights (after optimizer.step() is called) Co-authored-by: Brian Johnson <brianjo@fb.com> Co-authored-by: holly1238 <77758406+holly1238@users.noreply.github.com>
1 parent fc1de5f commit 533531f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beginner_source/ptcheat.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Learning rate scheduling
237237
.. code-block:: python
238238
239239
scheduler = optim.X(optimizer,...) # create lr scheduler
240-
scheduler.step() # update lr at start of epoch
240+
scheduler.step() # update lr after optimizer updates weights
241241
optim.lr_scheduler.X # where X is LambdaLR, MultiplicativeLR,
242242
# StepLR, MultiStepLR, ExponentialLR,
243243
# CosineAnnealingLR, ReduceLROnPlateau, CyclicLR,

0 commit comments

Comments
 (0)