[tune] Doc: Autofilled, StatusReporter (#3294)

* autofill and revise doc page for things

* lint

* comments
This commit is contained in:
Richard Liaw
2018-11-13 13:15:56 -08:00
committed by Eric Liang
parent 6ee7a3b571
commit c3a2c7ebed
4 changed files with 101 additions and 77 deletions
+7 -3
View File
@@ -14,11 +14,12 @@ logger = logging.getLogger(__name__)
class StatusReporter(object):
"""Object passed into your main() that you can report status through.
"""Object passed into your function that you can report status through.
Example:
>>> reporter = StatusReporter()
>>> reporter(timesteps_total=1)
>>> def trainable_function(config, reporter):
>>> assert isinstance(reporter, StatusReporter)
>>> reporter(timesteps_total=1)
"""
def __init__(self):
@@ -33,6 +34,9 @@ class StatusReporter(object):
Args:
kwargs: Latest training result status.
Example:
>>> reporter(mean_accuracy=1, training_iteration=4)
"""
with self._lock:
+4
View File
@@ -4,6 +4,8 @@ from __future__ import print_function
import os
# yapf: disable
# __sphinx_doc_begin__
# (Optional/Auto-filled) training is terminated. Filled only if not provided.
DONE = "done"
@@ -37,6 +39,8 @@ TIME_TOTAL_S = "time_total_s"
# (Auto-filled) The index of this training iteration.
TRAINING_ITERATION = "training_iteration"
# __sphinx_doc_end__
# yapf: enable
# Where Tune writes result files by default
DEFAULT_RESULTS_DIR = (os.environ.get("TUNE_RESULT_DIR")