Skip to content

Commit

Permalink
Merge pull request #16 from ablaom/dev
Browse files Browse the repository at this point in the history
For a new 0.1.5 release
  • Loading branch information
ablaom authored Mar 11, 2021
2 parents 952d984 + 2e3aaa1 commit b357396
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "EarlyStopping"
uuid = "792122b4-ca99-40de-a6bc-6742525f08b6"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "0.1.4"
version = "0.1.5"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
| [![Build status](https://github.com/ablaom/EarlyStopping.jl/workflows/CI/badge.svg)](https://github.com/ablaom/EarlyStopping.jl/actions)| [![codecov.io](http://codecov.io/github/ablaom/EarlyStopping.jl/coverage.svg?branch=master)](http://codecov.io/github/ablaom/EarlyStopping.jl?branch=master) |

A small package for applying early stopping criteria to
loss-generating iterative algorithms, with a view to applications to
training and optimization of machine learning models.
loss-generating iterative algorithms, with a view
to training and optimizing machine learning models.

The basis of [IterationControl.jl](https://github.com/ablaom/IterationControl.jl),
a package externally controlling iterative algorithms.

Includes the stopping criteria surveyed in [Prechelt, Lutz
(1998)](https://link.springer.com/chapter/10.1007%2F3-540-49430-8_3):
Expand Down Expand Up @@ -36,7 +39,7 @@ two of these criteria (either triggering the stop):
```julia
using EarlyStopping

stopper = EarlyStopper(Patience(2), NotANumber()) # muliple criteria
stopper = EarlyStopper(Patience(2), NotANumber()) # multiple criteria
done!(stopper, 0.123) # false
done!(stopper, 0.234) # false
done!(stopper, 0.345) # true
Expand Down Expand Up @@ -151,7 +154,7 @@ julia> stopping_time(Patience(3), [10.0, 3.0, 4.0, 5.0], verbosity=1)
0
```
If the lossses include both training and out-of-sample losses as
If the losses include both training and out-of-sample losses as
described above, pass an extra `Bool` vector marking the training
losses with `true`, as in
Expand Down
4 changes: 2 additions & 2 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ update_training(::StoppingCriterion, loss, state) = state
# returns whether it's time to stop:
done(::StoppingCriterion, state) = false

message(criterion::StoppingCriterion, state) = "Early stop triggered by "*
message(criterion::StoppingCriterion, state) = "Stop triggered by "*
"$criterion stopping criterion. "

needs_loss(::Type) = false
needs_training_losses(::Type) = false

for trait in [:needs_loss, :needs_training_losses]
eval(:($trait(c::StoppingCriterion) = $trait(typeof(c))))
eval(:($trait(c) = $trait(typeof(c))))
end
2 changes: 1 addition & 1 deletion test/disjunction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ end
state = EarlyStopping.update(d, 1.0)
state = EarlyStopping.update(d, 2.0, state)
@test EarlyStopping.message(d, state) ==
"Early stop triggered by Patience(1) stopping criterion. "
"Stop triggered by Patience(1) stopping criterion. "

0 comments on commit b357396

Please sign in to comment.