Unverified Commit 1ae77784 authored by anj-s's avatar anj-s Committed by GitHub
Browse files

[fix][adascale] Fix infinite loop in docstring (#656)

* fix infinite loop in docstring

* fix docstring
parent 69cbdf5d
...@@ -74,7 +74,7 @@ class AdaScale(Optimizer): ...@@ -74,7 +74,7 @@ class AdaScale(Optimizer):
last_epoch = 0 last_epoch = 0
done = False done = False
step = 0 step = 0
while True: while not done:
for batch in dataset: for batch in dataset:
optim.zero_grad() optim.zero_grad()
logits = model() logits = model()
...@@ -86,7 +86,7 @@ class AdaScale(Optimizer): ...@@ -86,7 +86,7 @@ class AdaScale(Optimizer):
if epoch > last_epoch: if epoch > last_epoch:
scheduler.step() scheduler.step()
last_epoch = epoch last_epoch = epoch
if epoch >= max_epochs: if epoch >= MAX_EPOCHS:
done = True done = True
Example 2: using a custom `update_lr()` function that update the learning Example 2: using a custom `update_lr()` function that update the learning
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment