netket.callbacks.InvalidLossStopping#
- class netket.callbacks.InvalidLossStopping[source]#
Bases:
Pytree
A simple callback to stop the optimisation when the monitored quantity becomes invalid for at least patience steps.
- Inheritance
- __init__(monitor='mean', patience=0)[source]#
Construct a callback stopping the optimisation when the monitored quantity becomes invalid for at least patience steps.
- Parameters:
monitor (
str
) – a string with the name of the quantity to be monitored. This is applied to the standard loss optimised by a driver, such as the Energy for the VMC driver. Should be one of ‘mean’, ‘variance’, ‘error_of_mean’ (default: ‘mean’).patience (
int
|float
) – Number of steps to wait before stopping the execution after the tracked quantity becomes invalid (default 0, meaning that it stops immediately).
- Attributes
- Methods
- __call__(step, log_data, driver)[source]#
A boolean function that determines whether or not to stop training.
- Parameters:
step – An integer corresponding to the step (iteration or epoch) in training.
log_data – A dictionary containing log data for training.
driver – A NetKet variational driver.
- Returns:
A boolean. If True, training continues, else, it does not.