[tune] Add command line support for choosing early stopping schedulers (#1209)

* command line support

* add checkpoint freq

* fix other flags

* fix

* docs

* doc
This commit is contained in:
Eric Liang
2017-11-12 12:05:18 -08:00
committed by Richard Liaw
parent afdc87323f
commit 7c38f964b7
11 changed files with 218 additions and 101 deletions
+2 -2
View File
@@ -60,7 +60,7 @@ class Trial(object):
def __init__(
self, env_creator, alg, config={}, local_dir='/tmp/ray',
experiment_tag=None, resources=Resources(cpu=1, gpu=0),
stopping_criterion={}, checkpoint_freq=None,
stopping_criterion={}, checkpoint_freq=0,
restore_path=None, upload_dir=None):
"""Initialize a new trial.
@@ -179,7 +179,7 @@ class Trial(object):
def should_checkpoint(self):
"""Whether this trial is due for checkpointing."""
if self.checkpoint_freq is None:
if not self.checkpoint_freq:
return False
return self.last_result.training_iteration % self.checkpoint_freq == 0