Skip to content

Commit

Permalink
Fix configure_optimizers example (#20420)
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Chu <[email protected]>
  • Loading branch information
chualanagit and Alan Chu authored Nov 14, 2024
1 parent 20d19d2 commit cd2bd3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/fabric/build_your_own_trainer/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def training_step(self, batch, batch_idx: int):

def configure_optimizers(self):
optim = torch.optim.Adam(self.parameters(), lr=1e-4)
return optim, {
return {
"optimizer": optim,
"scheduler": torch.optim.lr_scheduler.ReduceLROnPlateau(optim, mode="max", verbose=True),
"monitor": "val_accuracy",
"interval": "epoch",
Expand Down

0 comments on commit cd2bd3c

Please sign in to comment.