tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Improve LR scheduler documentation in transfer learning tutorial

Open sammy-1904 opened this issue 1 month ago • 2 comments

Description

This PR improves the documentation and comments related to the learning rate scheduler (StepLR) in the transfer_learning_tutorial.py script.

Changes made:

  • Added clarification about the recommended order: optimizer.step() followed by scheduler.step().
  • Explained why StepLR is stepped once per epoch in this tutorial.
  • Improved clarity of the backward/optimizer comment inside the training loop.
  • Updated comments to align with current PyTorch best practices.

No functional changes were made. This is a documentation only improvement.

Checklist

  • [x] The issue being addressed is documentation clarity (no existing issue number)
  • [x] Only one change area is addressed in this PR
  • [x] No unnecessary changes are included
  • [x] PR follows PyTorch Tutorials contribution guidelines

sammy-1904 avatar Dec 02 '25 13:12 sammy-1904