Repository navigation
Conversation
jrusbo
requested review from
ashwinvaidya17,
rajeshgangireddy and
samet-akcay
as code owners
October 25, 2026 19:15
jrusbo
force-pushed
the
fix/model/lr-scheduler-step-interval
branch
2 times, most recently
from
October 28, 2026 09:57
3130bd8 to
44d13f0
Compare
Contributor
Author
|
The only failures in |
jrusbo
force-pushed
the
fix/model/lr-scheduler-step-interval
branch
2 times, most recently
from
November 11, 2026 14:26
dad1729 to
899719a
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
UniNet’s single-epoch scheduler prematurely reduces the learning rate, the new unit test can trigger network downloads, and the scheduler changes lack targeted regression coverage.
3 open issues
What changed in this PR
This PR addresses #3878 by making learning-rate scheduler intervals explicit in five anomaly-detection models and adding automatic learning-rate monitoring to the Engine.
Changes:
- Configure step-based scheduling, retaining UniNet’s epoch fallback.
- Attach
LearningRateMonitorwhen logging is enabled, respecting barebones mode and existing monitors. - Add callback-registration coverage and changelog entries.
| File | Description |
|---|---|
tests/unit/engine/test_engine.py |
Tests monitor registration with and without a logger. |
src/anomalib/models/image/uninet/lightning_model.py |
Selects step or epoch scheduling and integer milestones. |
src/anomalib/models/image/uflow/lightning_model.py |
Sets LinearLR to step per optimizer update. |
src/anomalib/models/image/inp_former/lightning_model.py |
Sets warmup/cosine scheduling to step intervals. |
src/anomalib/models/image/efficient_ad/lightning_model.py |
Sets StepLR to step intervals and updates return typing. |
src/anomalib/models/image/dinomaly/lightning_model.py |
Sets warmup/cosine scheduling to step intervals. |
src/anomalib/engine/engine.py |
Automatically registers learning-rate monitoring when appropriate. |
CHANGELOG.md |
Records scheduler fixes and automatic monitoring. |
Review effort: Balanced
- Wrap step-based learning rate schedulers with interval="step" across EfficientAd, Dinomaly, InpFormer, Uflow, and UniNet so schedulers decay per batch step instead of per epoch. - Auto-attach LearningRateMonitor in Engine when a logger is configured. - Add unit test for engine callback setup. - Update CHANGELOG.md under Unreleased. Signed-off-by: Joaquin Rus Bono <jrusbo@gmail.com>
Signed-off-by: Joaquin Rus Bono <joaquin.rus.bono@anticipate.ml>
jrusbo
force-pushed
the
fix/model/lr-scheduler-step-interval
branch
from
November 13, 2026 14:39
be9a8fc to
2f17083
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


📝 Description
interval="epoch").LearningRateMonitorinEnginewhen a logger is configured.✨ Changes
StepLRis defined withstep_size = int(0.95 * num_steps)(wherenum_stepsis total batch steps). Previously,configure_optimizers()returned{"optimizer": optimizer, "lr_scheduler": scheduler}. In PyTorch Lightning, a raw scheduler object defaults tointerval="epoch", causing the scheduler to step only once per epoch instead of once per batch step. Wrapped with{"scheduler": scheduler, "interval": "step"}.These models returned
[optimizer], [scheduler]with step-based configurations. Wrapped with standard dictionary format.Auto-attached
LearningRateMonitor(logging_interval="step")inEnginewhen a logger is active, allowing step-level LR updates to be visible in MLflow or TensorBoard....Select what type of change your PR is:
✅ Checklist
Before you submit your pull request, please make sure you have completed the following steps:
For more information about code review checklists, see the Code Review Checklist.