Lightning-AI / Lightning-AI/pytorch-lightning

EarlyStopping Callback relative threshold mode

Open
#12,094 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

callback: early stopping design feature
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

🚀 Feature

Provide the option to evaluate relative changes to the tracked metric in the EarlyStoppingCallback instead of the absolute difference.

Motivation

I'm working on keypoint detection for robot manipulation and use a BCELoss in which the optimal value is the entropy of the ground truth heatmaps, which can change depending on the number of keypoints, number of channels, size of the gaussian blobs... Hence it is hard to specify the desired minimal absolute delta. It would be nice if we could specify a relative delta.

Additional context

Inspired by the Torch learning rate schedulers.

cc @borda @tchaton @justusschock @awaelchli @carmocca @rohitgr7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the EarlyStoppingCallback implementation and read the linked PyTorch ReduceLROnPlateau documentation for its relative-threshold behavior. Trace how the callback currently evaluates absolute metric changes, then define the configuration and verification needed so relative changes are evaluated correctly alongside the existing mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.