mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 21:38:18 +08:00
[tune] Doc: Autofilled, StatusReporter (#3294)
* autofill and revise doc page for things * lint * comments
This commit is contained in:
@@ -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,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")
|
||||
|
||||
Reference in New Issue
Block a user