Lightning-AI / Lightning-AI/pytorch-lightning
Refactor LearningRateMonitor
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
### Outline & Motivation
- `self.last_momentum_values` does not seem needed, but I may be overlooking something.
- Instead of returning the name with `-momentum` suffix when logging betas, just log it with `-beta` suffix.
- If logging betas, log all of them. The name could therefore be `-beta0`, `-beta1` in the case of Adam.
- Change the current logging names, e.g., `lr-Adam` to `optimizer-Adam-lr` and `lr-Adam-momentum` to `optimizer-Adam-momentum` (it doesn't have momentum this is just for demonstration, it would actually be `optimizer-Adam-beta0`, `optimizer-Adam-beta1`).
- remove the `log_momentum` argument as it can be inferred automatically.
### Pitch
Happy to open a PR with these changes.
### Additional context
_No response_
cc @borda @justusschock @awaelchli
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the LearningRateMonitor implementation and its tests, then trace how optimizer learning rates, momentum, and betas are currently discovered and logged. Done means the unnecessary state and argument are removed, all requested logging names and beta values are covered, and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100