jaxchem.utils

class EarlyStopping(patience=10, delta=0, is_greater_better=True)[source]

Early stops the training if score doesn’t improve after a given patience.

__init__(patience=10, delta=0, is_greater_better=True)[source]
Parameters
  • patience (int) – How long to wait after last time validation loss improved, default to be 10.

  • delta (float) – Minimum change in the monitored quantity to qualify as an improvement, default to be 0.

  • is_greater_better (bool) – Whether the greater score is better or not default to be True.

update(score, checkpoints=None)[source]

Update early stopping counter.

Parameters
  • score (float) – validation score per epoch.

  • checkpoints (Any) – all parameters and states of training model.