Closed billylanchantin closed 8 months ago
Adds:
%Training.State{status: :cont | :halt}
This way the fun on %Training.Callback{} can have the spec:
fun
%Training.Callback{}
fun :: State.t() -> State.t()
instead of wrapping the output in a tuple. It also means we can write code like this:
state = state |> run_callbacks(callbacks, :before_training) |> run_training(callbacks, dmat, objective) |> run_callbacks(callbacks, :after_training)
since now run_callbacks/3 and run_training/4 (new) can branch on state.status.
run_callbacks/3
run_training/4
state.status
I did some other code shuffling while I was in there, but none of it is crucial.
Adds:
%Training.State{status: :cont | :halt}
This way the
fun
on%Training.Callback{}
can have the spec:fun :: State.t() -> State.t()
instead of wrapping the output in a tuple. It also means we can write code like this:
since now
run_callbacks/3
andrun_training/4
(new) can branch onstate.status
.I did some other code shuffling while I was in there, but none of it is crucial.