# Bjarten/early-stopping-pytorch

Early stopping for PyTorch

Repository: https://github.com/Bjarten/early-stopping-pytorch
Canonical: https://ross.abutalabs.com/products/early-stopping-pytorch
Language: Jupyter Notebook
License: MIT
License Family: permissive
Topics: pytorch, early-stopping, early, stopping, pytorch-tutorial, python, mnist, regularization, tutorial
Last push: 2024-11-11T10:34:07+00:00

## Health v2 (maintenance only)
Score: 34/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 40, longevity 100
- inputs: {"age_days": 2804, "days_push": 660, "days_rel": 660, "gap_med": 0, "n_releases_24m": 10}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1266, forks 288 (observed 2026-08-28T04:04:11.194719+00:00)

## What it is
A small PyTorch utility package providing an EarlyStopping class that monitors validation loss during training and stops when it stops improving. It also saves model checkpoints whenever validation loss decreases.

## Use cases
- stop pytorch training when validation loss stops improving
- prevent overfitting in pytorch model training
- save best model checkpoint during training
- add early stopping with patience to training loop
- regularize deep learning model training

## When to choose
- you train PyTorch models and want simple early stopping with checkpointing
- you want a lightweight pip-installable utility rather than a full training framework

## When to avoid
- you use TensorFlow/Keras, which has built-in early stopping callbacks
- you need a full experiment tracking or training framework like PyTorch Lightning or Ignite

## Facets
- artifact type: library
- maturity: stable
- function: machine-learning, developer-tools
- domain: machine-learning, deep-learning
- platform: python
- tags: pytorch, early-stopping, regularization, model-training, checkpointing

## Member repositories
- Bjarten/early-stopping-pytorch (main) score 34

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:11.194719+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:03:45.365658+00:00, confidence not recorded.
  - readme: https://github.com/Bjarten/early-stopping-pytorch (fetched 2026-08-28T04:04:11.194719+00:00, sha 1032a1404c42)
  - registry_pypi: https://pypi.org/pypi/early-stopping-pytorch/json (fetched 2026-08-29T12:15:50.919115+00:00, sha 42422ca85e14)
- Data as of 2026-08-30T08:39:29.467469+00:00.
