netket.callbacks

netket.callbacks#

Those callbacks can be used with the optimisation drivers.

For a detailed description of the run loop and all available callback hooks, see The Run Loop and Callback Hooks.

Abstract base class#

AbstractCallback

Abstract base class for callbacks in advanced variational drivers.

StopRun

Exception to be raised by callbacks to gracefully stop the optimisation loop.

Built-in callbacks#

EarlyStopping

A simple callback to stop NetKet if there are no more improvements in the training.

ConvergenceStopping

A simple callback to stop the optimisation when the monitored quantity gets below a certain threshold for at least patience steps.

InvalidLossStopping

A simple callback to stop the optimisation when the monitored quantity becomes invalid for at least patience steps.

Timeout

A simple callback to stop NetKet after some time has passed.

AutoChunkSize

Automatically tunes the chunk size for the (i) sampler, (ii) forward pass and (iii) backward pass of a driver and a variational state in order to avoid OOM errors.

AutoSlurmRequeue

A callback that automatically requeues a Slurm job if it is about to run out of time.