Skip to content

Implemented feature - #511

Open
PragyaPandey5 wants to merge 2 commits into
kozistr:mainfrom
PragyaPandey5:main
Open

Implemented feature#511
PragyaPandey5 wants to merge 2 commits into
kozistr:mainfrom
PragyaPandey5:main

Conversation

@PragyaPandey5

@PragyaPandey5 PragyaPandey5 commented Jul 5, 2026

Copy link
Copy Markdown

Problem (Why?)

The project did not include an exponential learning rate scheduler with linear warmup. Adding this scheduler provides users with another learning rate scheduling strategy for training PyTorch models.

_What problem are you trying to solve?
Added an ExponentialScheduler with linear warmup to provide an additional learning rate scheduling option for PyTorch models.

Solution (What/How?) - - Added an example demonstrating how to use the learning rate scheduler.

  • Implemented a new ExponentialScheduler with linear warmup.
  • Added validation for the gamma parameter.
  • Registered the scheduler in the lr_scheduler package.
  • Added an example demonstrating how to use the scheduler.
  • Added and updated unit tests to verify the scheduler's behavior.
  • Verified that the test suite passes successfully.

How did you solve the problem? Please provide a complete description and explanation!
Implemented a new ExponentialScheduler with linear warmup by extending the existing scheduler framework. Added validation for the gamma parameter, registered the scheduler in the lr_scheduler package, created an example demonstrating its usage, and added unit tests to verify its functionality. Finally, ran the test suite to ensure the new scheduler integrates correctly with the existing codebase.

Other changes (bug fixes, small refactors) - no additional changes

_Are there any small changes? yes

Notes None.

Please note any questions, helps or contexts what maintainer(s) should know

Checklist

  • Make sure to run make format before commit
  • My code adheres to the style guidelines of this project (make check shows no errors)
  • ✅ Both new and existing unit tests pass successfully on my local environment by running make test
  • I have made the necessary changes to the documentation

On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

@PragyaPandey5
PragyaPandey5 requested a review from kozistr as a code owner July 5, 2026 05:55
@github-actions github-actions Bot added the lr_scheduler about learning rate scheduler label Jul 5, 2026
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.99%. Comparing base (04ce936) to head (dd42494).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pytorch_optimizer/lr_scheduler/linear_warmup.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main     #511      +/-   ##
===========================================
- Coverage   100.00%   99.99%   -0.01%     
===========================================
  Files          127      127              
  Lines        12309    12319      +10     
===========================================
+ Hits         12309    12318       +9     
- Misses           0        1       +1     
Flag Coverage Δ
3.10 99.99% <90.90%> (-0.01%) ⬇️
3.11 99.99% <90.90%> (-0.01%) ⬇️
3.12 99.99% <90.90%> (-0.01%) ⬇️
3.13 99.99% <90.90%> (-0.01%) ⬇️
3.14 99.99% <90.90%> (-0.01%) ⬇️
3.8 99.98% <90.90%> (-0.01%) ⬇️
3.9 99.98% <90.90%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kozistr kozistr left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! thanks for the PR!

Overall, looks good to me! Could you fix the lint issue and test coverage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lr_scheduler about learning rate scheduler size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants