# \[ANN\] EarlyStopping.jl 0.1.0: For terminating iterative algorithms

**URL:** <https://discourse.julialang.org/t/ann-earlystopping-jl-0-1-0-for-terminating-iterative-algorithms/55740>\
**Category:** Statistics\
**Created:** [February 21, 2021, 8:51pm UTC](https://discourse.julialang.org/t/ann-earlystopping-jl-0-1-0-for-terminating-iterative-algorithms/55740 "2021-02-21T20:51:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Post date:** [February 21, 2021, 8:51pm UTC](https://discourse.julialang.org/t/ann-earlystopping-jl-0-1-0-for-terminating-iterative-algorithms/55740/1 "2021-02-21T20:51:58Z")

</div>

The `EarlyStopper` objects defined in [EarlyStopping.jl](https://github.com/ablaom/EarlyStopping.jl) consume a sequence of numbers called _losses_ generated by some external algorithm - generally the training loss or out-of-sample loss of some iterative statistical model - and decide when those losses have dropped sufficiently to warrant terminating the algorithm.

The package is mainly intended for developers in the ML space. There is [a plan](https://github.com/alan-turing-institute/MLJ.jl/issues/139) to use it in MLJ.jl in a model wrapper for controlling iterative models (including “self-tuning” models).

A number of commonly applied _stopping criteria_ are included out-of-the-box, including all those surveyed in the paper [Prechelt, Lutz (1998)](https://link.springer.com/chapter/10.1007%2F3-540-49430-8_3):  
“Early Stopping - But When?”, in _Neural Networks: Tricks of the Trade_, ed. G. Orr, Springer.

| criterion | description | notation in Prechelt |
| --- | --- | --- |
| `Never()` | Never stop | |
| `NotANumber()` | Stop when `NaN` encountered | |
| `TimeLimit(t=0.5)` | Stop after `t` hours | |
| `GL(alpha=2.0)` | Stop after “Generalization Loss” exceeds `alpha` | `GL_α` |
| `PQ(alpha=0.75, k=5)` | Stop after “Progress-modified GL” exceeds `alpha` | `PQ_α` |
| `Patience(n=5)` | Stop after `n` consecutive loss increases | `UP_s` |
| `Disjunction(c...)` | Stop when any of the criteria `c` apply | |
