netket.callbacks.InvalidLossStopping#

class netket.callbacks.InvalidLossStopping[source]#

Bases: object

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

Inheritance
Inheritance diagram of netket.callbacks.InvalidLossStopping
Attributes
monitor: str = 'mean'#

Loss statistic to monitor. Should be one of ‘mean’, ‘variance’, ‘sigma’.

patience: Union[int, float] = 0#

Number of epochs with invalid loss after which training will be stopped.

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.

replace(**updates)#

Returns a new object replacing the specified fields with new values.