From c2004f292db941796aa042c2746050441344092c Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Wed, 24 Mar 2021 17:02:45 +1300 Subject: [PATCH 1/5] typo --- src/controls.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controls.jl b/src/controls.jl index 5516bb4..1b2f877 100644 --- a/src/controls.jl +++ b/src/controls.jl @@ -15,7 +15,7 @@ Step(; n=5) = Step(n) function update!(c::Step, model, verbosity, args...) if verbosity > 1 - @info "Steping model for $(c.n) iterations. " + @info "Stepping model for $(c.n) iterations. " else nothing end From f08795dcc345813c066e554a51dcb59bb1280a06 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Wed, 24 Mar 2021 17:10:48 +1300 Subject: [PATCH 2/5] tweak --- src/utilities.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities.jl b/src/utilities.jl index 0add353..7985174 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -3,7 +3,7 @@ function detailed_doc_string(M; header="", example="", body="") ret = " $header" ret *= "\n\n" - ret *= "An iteration control, as in `$example`. " + ret *= "An iteration control, as in, `$example`. " ret *= "\n\n" ret *= body return ret From c25205463ec18a1e032e5baeec90aaa87f3ace93 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 29 Mar 2021 16:51:08 +1300 Subject: [PATCH 3/5] fix invalid test --- test/train.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/train.jl b/test/train.jl index 91ace0d..d61b05f 100644 --- a/test/train.jl +++ b/test/train.jl @@ -12,9 +12,9 @@ @test_logs((:info, r"Stop triggered by Num"), IC.train!(m, Step(2), NotANumber(), NumberLimit(3))); @test_logs((:info, r"Using these controls"), - (:info, r"Steping model for 2 iterations"), - (:info, r"Steping model for 2 iterations"), - (:info, r"Steping model for 2 iterations"), + (:info, r"Stepping model for 2 iterations"), + (:info, r"Stepping model for 2 iterations"), + (:info, r"Stepping model for 2 iterations"), (:info, r"Stop triggered by NumberLimit"), IC.train!(m, Step(2), NotANumber(), From 944dcdaaa11df8a1363dde49162f5eaf4a5dcb00 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 29 Mar 2021 16:53:10 +1300 Subject: [PATCH 4/5] address new julia 1.6 warnings in tests --- test/controls.jl | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/controls.jl b/test/controls.jl index c980eca..27331f1 100644 --- a/test/controls.jl +++ b/test/controls.jl @@ -132,9 +132,9 @@ end @test IC.takedown(c, 0, state) == (done = false, log="") v = Float64[] - f(model) = (push!(v, IC.loss(model)); last(v) < 0.02) + f2(model) = (push!(v, IC.loss(model)); last(v) < 0.02) - c = Callback(f, stop_if_true=true) + c = Callback(f2, stop_if_true=true) m = SquareRooter(4) IC.train!(m, 1) state = IC.update!(c, m, 1) @@ -149,9 +149,9 @@ end log="Stop triggered by a `Callback` control. ") v = Float64[] - f(model) = (push!(v, IC.loss(model)); last(v) < 0.02) + f3(model) = (push!(v, IC.loss(model)); last(v) < 0.02) - c = Callback(f, stop_if_true=true, stop_message="foo") + c = Callback(f3, stop_if_true=true, stop_message="foo") m = SquareRooter(4) IC.train!(m, 1) state = IC.update!(c, m, 1) @@ -184,8 +184,8 @@ end @test IC.takedown(c, 0, state) == (done = false, log="") v = Float64[] - f(loss) = (push!(v, loss); last(v) < 0.02) - c = WithLossDo(f, stop_if_true=true) + f2(loss) = (push!(v, loss); last(v) < 0.02) + c = WithLossDo(f2, stop_if_true=true) m = SquareRooter(4) IC.train!(m, 1) state = IC.update!(c, m, 1) @@ -200,8 +200,8 @@ end log="Stop triggered by a `WithLossDo` control. ") v = Float64[] - f(loss) = (push!(v, loss); last(v) < 0.02) - c = WithLossDo(f, stop_if_true=true, stop_message="foo") + f3(loss) = (push!(v, loss); last(v) < 0.02) + c = WithLossDo(f3, stop_if_true=true, stop_message="foo") m = SquareRooter(4) IC.train!(m, 1) state = IC.update!(c, m, 1) @@ -234,8 +234,8 @@ end @test IC.takedown(c, 0, state) == (done = false, log="") v = Float64[] - f(training_loss) = (push!(v, last(training_loss)); last(v) < 0.5) - c = WithTrainingLossesDo(f, stop_if_true=true) + f1(training_loss) = (push!(v, last(training_loss)); last(v) < 0.5) + c = WithTrainingLossesDo(f1, stop_if_true=true) m = SquareRooter(4) IC.train!(m, 1) state = IC.update!(c, m, 1) @@ -250,8 +250,8 @@ end log="Stop triggered by a `WithTrainingLossesDo` control. ") v = Float64[] - f(training_loss) = (push!(v, last(training_loss)); last(v) < 0.5) - c = WithTrainingLossesDo(f, stop_if_true=true, stop_message="foo") + f2(training_loss) = (push!(v, last(training_loss)); last(v) < 0.5) + c = WithTrainingLossesDo(f2, stop_if_true=true, stop_message="foo") m = SquareRooter(4) IC.train!(m, 1) state = IC.update!(c, m, 1) @@ -283,8 +283,8 @@ end @test IC.takedown(c, 0, state) == (done = false, log="") v = Int[] - f(n) = (push!(v, n); last(n) > 1) - c = WithNumberDo(f, stop_if_true=true) + f2(n) = (push!(v, n); last(n) > 1) + c = WithNumberDo(f2, stop_if_true=true) m = SquareRooter(4) IC.train!(m, 1) state = IC.update!(c, m, 1) @@ -299,8 +299,8 @@ end log="Stop triggered by a `WithNumberDo` control. ") v = Int[] - f(n) = (push!(v, n); last(n) > 1) - c = WithNumberDo(f, stop_if_true=true, stop_message="foo") + f3(n) = (push!(v, n); last(n) > 1) + c = WithNumberDo(f3, stop_if_true=true, stop_message="foo") m = SquareRooter(4) IC.train!(m, 1) state = IC.update!(c, m, 1) From 5456bd5d72163b564de9d1fa86ab6c41782843ef Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 29 Mar 2021 16:54:28 +1300 Subject: [PATCH 5/5] bump 0.3.1 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index bc67de8..f5e087e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "IterationControl" uuid = "b3c1a2ee-3fec-4384-bf48-272ea71de57c" authors = ["Anthony D. Blaom "] -version = "0.3.0" +version = "0.3.1" [deps] EarlyStopping = "792122b4-ca99-40de-a6bc-6742525f08b6"