Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EarlyStopper(NumberSinceBest(3), PQ()) errors immediately #28

Closed
awadell1 opened this issue Oct 20, 2021 · 1 comment · Fixed by #29
Closed

EarlyStopper(NumberSinceBest(3), PQ()) errors immediately #28

awadell1 opened this issue Oct 20, 2021 · 1 comment · Fixed by #29

Comments

@awadell1
Copy link
Collaborator

awadell1 commented Oct 20, 2021

julia> stopper = EarlyStopper(NumberSinceBest(3), PQ())
EarlyStopper{Disjunction{NumberSinceBest, PQ}}(Disjunction(NumberSinceBest(3), PQ(0.75, 5, 2.220446049250313e-16)), 0, #undef)

julia> done!(stopper, 1.0; training=true)
ERROR: type Nothing has no field number_since_best
Stacktrace:
 [1] getproperty(x::Nothing, f::Symbol)
   @ Base ./Base.jl:33
 [2] done(criterion::NumberSinceBest, state::Nothing)
   @ EarlyStopping ~/.julia/packages/EarlyStopping/O3BIV/src/criteria.jl:360
 [3] _done
   @ ~/.julia/packages/EarlyStopping/O3BIV/src/disjunction.jl:68 [inlined]
 [4] _done
   @ ~/.julia/packages/EarlyStopping/O3BIV/src/disjunction.jl:71 [inlined]
 [5] done(d::Disjunction{NumberSinceBest, PQ}, state::NamedTuple{(:a, :b), Tuple{Nothing, EarlyStopping.PQState{Float64}}})
   @ EarlyStopping ~/.julia/packages/EarlyStopping/O3BIV/src/disjunction.jl:74
 [6] done(stopper::EarlyStopper{Disjunction{NumberSinceBest, PQ}})
   @ EarlyStopping ~/.julia/packages/EarlyStopping/O3BIV/src/object_oriented_api.jl:44
 [7] done_after_update_training!(stopper::EarlyStopper{Disjunction{NumberSinceBest, PQ}}, loss::Float64)
   @ EarlyStopping ~/.julia/packages/EarlyStopping/O3BIV/src/object_oriented_api.jl:59
 [8] done!(stopper::EarlyStopper{Disjunction{NumberSinceBest, PQ}}, loss::Float64; training::Bool)
   @ EarlyStopping ~/.julia/packages/EarlyStopping/O3BIV/src/object_oriented_api.jl:69
 [9] top-level scope
   @ REPL[11]:1

Issues apears to be:

  • update_training(::NumberSinceBest, loss) dispatches to update_training(::StoppingCriterion, loss) = nothing
  • done(::NumberSinceBest, ::Nothing)` dispatches to ln 360 in src/criteria.jl -> which promptly errors out

Related to #5 but not caught by stopping_time, which check if training before calling done(criteria, state)

I can take a stab at fixing this / adding in new tests tomorrow

Best,

Alex

@ablaom
Copy link
Member

ablaom commented Oct 20, 2021

Great catch and diagnosis!

I can take a stab at fixing this / adding in new tests tomorrow

That would be awesome.

awadell1 added a commit to awadell1/EarlyStopping.jl that referenced this issue Oct 21, 2021
Expands existing test set by adding `test_criteria` macro for
testing functionality of a Stopping Criterion

Detects: JuliaAI#28
awadell1 added a commit to awadell1/EarlyStopping.jl that referenced this issue Oct 21, 2021
Expands existing test set by adding `test_criteria` macro for
testing functionality of a Stopping Criterion

Detects: JuliaAI#28
awadell1 added a commit to awadell1/EarlyStopping.jl that referenced this issue Oct 21, 2021
Expands existing test set by adding `test_criteria` macro for
testing functionality of a Stopping Criterion

Detects: JuliaAI#28
awadell1 added a commit to awadell1/EarlyStopping.jl that referenced this issue Oct 22, 2021
Expands existing test set by adding `test_criteria` macro for
testing functionality of a Stopping Criterion

Detects: JuliaAI#28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants