nemos.callbacks.SolverConvergenceCallback#
- class nemos.callbacks.SolverConvergenceCallback[source]#
Bases:
CallbackDelegate convergence checking to the solver’s built-in criterion.
Calls
ctx.solver.stochastic_convergence_criterion(...)at the end of each pass and requests a stop if it returnsTrue.Tracks previous params and state internally so the context doesn’t have to.
Methods
__init__()on_batch_begin(ctx)Run before each batch update.
on_batch_end(ctx)Run after each batch update.
on_pass_begin(ctx)Save current params and state before the pass runs.
on_pass_end(ctx)Check solver convergence criterion and request stop if met.
on_train_begin(ctx)Run once at the start of training.
on_train_end(ctx)Run once at the end of training.
- on_batch_begin(ctx)#
Run before each batch update.
- Return type:
- Parameters:
ctx (TrainingContext)
- on_batch_end(ctx)#
Run after each batch update.
- Return type:
- Parameters:
ctx (TrainingContext)
- on_pass_begin(ctx)[source]#
Save current params and state before the pass runs.
- Return type:
- Parameters:
ctx (TrainingContext)
- on_pass_end(ctx)[source]#
Check solver convergence criterion and request stop if met.
- Return type:
- Parameters:
ctx (TrainingContext)
- on_train_begin(ctx)#
Run once at the start of training.
- Return type:
- Parameters:
ctx (TrainingContext)
- on_train_end(ctx)#
Run once at the end of training.
- Return type:
- Parameters:
ctx (TrainingContext)