Skip to content

Commit

Permalink
[tune] tune.run keep_checkpoints_num (ray-project#5117)
Browse files Browse the repository at this point in the history
* Add missing argument keep_checkpoints_num to tune

* expose keep checkpoints
  • Loading branch information
morgangiraud authored and richardliaw committed Jul 8, 2019
1 parent 8f53364 commit 7e020e7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/ray/tune/tune.py
Expand Up @@ -49,6 +49,8 @@ def run(run_or_experiment,
sync_to_driver=None,
checkpoint_freq=0,
checkpoint_at_end=False,
keep_checkpoints_num=None,
checkpoint_score_attr=None,
global_checkpoint_period=10,
export_formats=None,
max_failures=3,
Expand Down Expand Up @@ -114,6 +116,13 @@ def run(run_or_experiment,
checkpoints. A value of 0 (default) disables checkpointing.
checkpoint_at_end (bool): Whether to checkpoint at the end of the
experiment regardless of the checkpoint_freq. Default is False.
keep_checkpoints_num (int): Number of checkpoints to keep. A value of
`None` keeps all checkpoints. Defaults to `None`. If set, need
to provide `checkpoint_score_attr`.
checkpoint_score_attr (str): Specifies by which attribute to rank the
best checkpoint. Default is increasing order. If attribute starts
with `min-` it will rank attribute in decreasing order, i.e.
`min-validation_loss`.
global_checkpoint_period (int): Seconds between global checkpointing.
This does not affect `checkpoint_freq`, which specifies frequency
for individual trials.
Expand Down Expand Up @@ -199,6 +208,8 @@ def run(run_or_experiment,
loggers=loggers,
checkpoint_freq=checkpoint_freq,
checkpoint_at_end=checkpoint_at_end,
keep_checkpoints_num=keep_checkpoints_num,
checkpoint_score_attr=checkpoint_score_attr,
export_formats=export_formats,
max_failures=max_failures,
restore=restore,
Expand Down

0 comments on commit 7e020e7

Please sign in to comment.