Train Module#
Train module.
- class landmarker.train.EarlyStopping[source]#
Early stopping to stop the training when the score does not improve after certain epochs. source: https://debuggercafe.com/using-learning-rate-scheduler-and-early-stopping-with-pytorch/
- Parameters:
patience (int, optional) β Number of epochs to wait for the score to improve. Defaults to 25.
min_delta (float, optional) β Minimum difference between new score and old score for new score to be considered as an improvement. Defaults to 0.0.
verbose (bool, optional) β Whether to print the logs or not. Defaults to False.
greater_is_better (bool, optional) β Whether the new score is expected to be greater than previous scores or not. Defaults to False.
name_score (str, optional) β Name of the score being tracked. Defaults to βVal Lossβ.
- class landmarker.train.SaveBestModel[source]#
Save the best model based on validation metric/loss.
- Parameters:
verbose (bool, optional) β Whether to print the logs or not. Defaults to False.
greater_is_better (bool, optional) β Whether the new score is expected to be greater than previous scores or not. Defaults to False.
name_score (str, optional) β Name of the score being tracked. Defaults to βVal Lossβ.