nemos.callbacks.SolverConvergenceCallback#

class nemos.callbacks.SolverConvergenceCallback[source]#

Bases: Callback

Delegate 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 returns True.

Tracks previous params and state internally so the context doesn’t have to.

__init__()[source]#

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:

None

Parameters:

ctx (TrainingContext)

on_batch_end(ctx)#

Run after each batch update.

Return type:

None

Parameters:

ctx (TrainingContext)

on_pass_begin(ctx)[source]#

Save current params and state before the pass runs.

Return type:

None

Parameters:

ctx (TrainingContext)

on_pass_end(ctx)[source]#

Check solver convergence criterion and request stop if met.

Return type:

None

Parameters:

ctx (TrainingContext)

on_train_begin(ctx)#

Run once at the start of training.

Return type:

None

Parameters:

ctx (TrainingContext)

on_train_end(ctx)#

Run once at the end of training.

Return type:

None

Parameters:

ctx (TrainingContext)