Skip to content

Commit

Permalink
Fix PyTorch lightning total steps
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Apr 18, 2023
1 parent 3f60d16 commit 1e43bdc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions examples/pysr_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1118,14 +1118,12 @@
" return self.training_step(batch, batch_idx)\n",
"\n",
" def configure_optimizers(self):\n",
" self.trainer.reset_train_dataloader()\n",
"\n",
" optimizer = torch.optim.Adam(self.parameters(), lr=self.max_lr)\n",
" scheduler = {\n",
" \"scheduler\": torch.optim.lr_scheduler.OneCycleLR(\n",
" optimizer,\n",
" max_lr=self.max_lr,\n",
" total_steps=self.total_steps,\n",
" total_steps=self.trainer.estimated_stepping_batches,\n",
" final_div_factor=1e4,\n",
" ),\n",
" \"interval\": \"step\",\n",
Expand Down

0 comments on commit 1e43bdc

Please sign in to comment.