export Module

Exports experiment run history data to Tensorboard logs suitable for viewing in a Tensorboard instance.

Functions

export_to_tensorboard

Export experiment run history to Tensorboard logs ready for Tensorboard visualization.

export_to_tensorboard(run_data, logsdir, logger=None, recursive=True)

Parameters

Name Description
run_data
Required

A run or a list of runs to export.

logsdir
Required
str

A directory path where logs are exported.

logger

Optional user-specified logger.

Default value: None
recursive

Specifies whether to recursively retrieve all child runs for specified runs.

Default value: True

Remarks

This function enables you to view experiment run history in a Tensorboard instance. Use it for Azure Machine learning experiments and other machine learning frameworks that don't natively output log files consumable in Tensorboard. For more information about using Tensorboard, see Visualize experiment runs and metrics with Tensorboard.

The following example shows how to use the export_to_tensorboard function to export machine learning logs for viewing in TensorBoard. In this example, experiment has completed and the run history is stored in Tensorboard logs.


   # Export Run History to Tensorboard logs
   from azureml.tensorboard.export import export_to_tensorboard
   import os

   logdir = 'exportedTBlogs'
   log_path = os.path.join(os.getcwd(), logdir)
   try:
       os.stat(log_path)
   except os.error:
       os.mkdir(log_path)
   print(logdir)

   # export run history for the project
   export_to_tensorboard(root_run, logdir)

   # or export a particular run
   # export_to_tensorboard(run, logdir)

Full sample is available from https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/track-and-monitor-experiments/tensorboard/export-run-history-to-tensorboard/export-run-history-to-tensorboard.ipynb