Edit on GitHub

Live()

Initializes a DVCLive logger.

class Live:

    def __init__(
        self,
        dir: str = "dvclive",
        resume: bool = False,
        report: Optional[str] = "auto",
        save_dvc_exp: bool = False,
        dvcyaml: bool = True,
        exp_message: Optional[str] = None,
    ):

Usage

from dvclive import Live

with Live() as live:
    ...

Description

A Live() instance is required in order to log machine learning parameters, metrics and other metadata.

Live() will remove all existing DVCLive related files under dir unless resume=True.

You can use Live() as a context manager. When exiting the context manager, Live.end() will be called.

Properties

  • step - See Live.next_step().

  • summary - See Live.make_summary().

  • dir - Location of the directory to store outputs.

  • dvc_file - {Live.dir}/dvc.yaml.

  • metrics_file - {Live.dir}/metrics.json.

  • params_file - {Live.dir}/params.yaml.

  • plots_dir - {Live.dir}/plots.

  • report_file - {Live.dir}/report.{format}. The format can be HTML (.html) or Markdown (.md) depending on the value of the report parameter.

Parameters

  • dir - Where to save DVCLive's outputs. Defaults to dvclive.

  • resume - If True, DVCLive will try to read the previous step from the metrics_file and start from that point. Defaults to False.

  • report - Any of auto, html, notebook, md or None. See Live.make_report().

    The auto mode (default) will use md format if the CI env var is present and matplotlib is installed and html otherwise.

    If report is None, Live.make_report() won't generate anything.

  • save_dvc_exp - If True, DVCLive will create a new DVC experiment as part of Live.end(). Defaults to False.

  • dvcyaml - If True, DVCLive will write DVC configuration for metrics, plots, and parameters to Live.dvc_file as part of Live.next_step() and Live.end(). See Live.make_dvcyaml(). Defaults to True.

    If you are already tracking DVCLive metrics, plots, and parameters in your own dvc.yaml file, set dvcyaml=False to avoid duplication.

  • exp_message - If not None, and save_dvc_exp is True, the provided string will be passed to dvc exp save --message.

    If DVCLive is used inside dvc exp run, the option will be ignored, use dvc exp run --message instead.

Methods

Content

🐛 Found an issue? Let us know! Or fix it:

Edit on GitHub

Have a question? Join our chat, we will help you:

Discord Chat