Skip to content

Commit

Permalink
Use step interval in estimated_stepping_batches docs example (#19774
Browse files Browse the repository at this point in the history
)
  • Loading branch information
daavoo authored Apr 15, 2024
1 parent ce90b38 commit 58ad56a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/source-pytorch/common/trainer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,10 @@ dataloader if hadn't been set up already.
optimizer = ...
stepping_batches = self.trainer.estimated_stepping_batches
scheduler = torch.optim.lr_scheduler.OneCycleLR(optimizer, max_lr=1e-3, total_steps=stepping_batches)
return [optimizer], [scheduler]
return {
"optimizer": optimizer,
"lr_scheduler": {"scheduler": scheduler, "interval": "step"},
}
state
*****
Expand Down

0 comments on commit 58ad56a

Please sign in to comment.