hookeai.model_architectures.procedures.model_state_files.check_best_state_file¶
- check_best_state_file(model, filename)[source]¶
Check if file is model best state file.
Model state file corresponding to the best performance is stored in model_directory under the name < model_name >-best.pt. or < model_name >-< epoch >-best.pt if the training epoch is known.
- Parameters:
model (torch.nn.Module) – Model.
filename (str) – File name.
- Returns:
is_best_state_file (bool) – True if model training epoch state file, False otherwise.
epoch ({None, int}) – Training epoch corresponding to model state file if is_best_state_file=True and training epoch is known, None otherwise.