tfm.core.train_utils.BestCheckpointExporter
Stay organized with collections
Save and categorize content based on your preferences.
Keeps track of the best result, and saves its checkpoint.
tfm.core.train_utils.BestCheckpointExporter(
export_dir: str, metric_name: str, metric_comp: str
)
Orbit will support an API for checkpoint exporter. This class will be used
together with orbit once this functionality is ready.
Args |
export_dir
|
The directory that will contain exported checkpoints.
|
metric_name
|
Indicates which metric to look at, when determining which
result is better. If eval_logs being passed to maybe_export_checkpoint
is a nested dictionary, use | as a seperator for different layers.
|
metric_comp
|
Indicates how to compare results. Either lower or higher .
|
Attributes |
best_ckpt_logs
|
|
best_ckpt_logs_path
|
|
best_ckpt_path
|
Returns the best ckpt path or None if there is no ckpt yet.
|
Methods
export_best_eval_metric
View source
export_best_eval_metric(
eval_logs, global_step
)
Export evaluation results of the best checkpoint into a json file.
maybe_export_checkpoint
View source
maybe_export_checkpoint(
checkpoint, eval_logs, global_step, write_logs=True
) -> bool
Compare eval_logs with past eval_logs and export checkpoint if better.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-02-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-02-02 UTC."],[],[]]