Skip to content

Commit

Permalink
Update optim.rst for better understanding (#45944)
Browse files Browse the repository at this point in the history
Summary:
The `i` variable in `Line 272` may cause ambiguity in understanding. I think it should be named as `epoch` variable.

Fixes #{issue number}

Pull Request resolved: #45944

Reviewed By: agolynski

Differential Revision: D24219486

Pulled By: vincentqb

fbshipit-source-id: 2af0408594613e82a1a1b63971650cabde2b576e
  • Loading branch information
yangsenius authored and facebook-github-bot committed Oct 14, 2020
1 parent 1f791c0 commit e7dbaa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/optim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ and start to collect SWA averages of the parameters at epoch 160:
>>> optimizer.zero_grad()
>>> loss_fn(model(input), target).backward()
>>> optimizer.step()
>>> if i > swa_start:
>>> if epoch > swa_start:
>>> swa_model.update_parameters(model)
>>> swa_scheduler.step()
>>> else:
Expand Down

0 comments on commit e7dbaa2

Please sign in to comment.