[Tune Docs] Logging doc fix (#9691)

This commit is contained in:
Amog Kamsetty
2020-07-24 11:20:52 -07:00
committed by GitHub
parent 6beed5a2df
commit 03709d67cb
+5 -3
View File
@@ -77,6 +77,8 @@ You can do this in the trainable, as shown below:
**Function API**:
``library`` refers to whatever 3rd party logging library you are using.
.. code-block:: python
def trainable(config):
@@ -86,12 +88,12 @@ You can do this in the trainable, as shown below:
resume=trial_id,
reinit=True,
allow_val_change=True)
library.set_log_path(tune.track.logdir)
library.set_log_path(tune.get_trial_dir())
for step in range(100):
library.log_model(...)
library.log(results, step=step)
tune.track.log(results)
tune.report(results)
**Class API**:
@@ -121,7 +123,7 @@ You can do this in the trainable, as shown below:
step = result["training_iteration"]
library.log(res_dict, step=step)
Use ``self.logdir`` (only for Class API) or ``tune.track.logdir`` (only for Function API) for the trial log directory.
Use ``self.logdir`` (only for Class API) or ``tune.get_trial_dir()`` (only for Function API) for the trial log directory.
In the distributed case, these logs will be sync'ed back to the driver under your logger path. This will allow you to visualize and analyze logs of all distributed training workers on a single machine.