Skip to content
Edit on GitHub

Live.log_param()

 def log_param(name: str, val: ParamLike):

Also see Live.log_params().

Usage

from dvclive import Live

live = Live()

live.log_param("lr", 1e-3)
live.log_param("n_iter", 50)

Description

On each live.log_param(name, val) call, DVCLive will write the name parameter to {Live.dir}/params.yaml with the corresponding val:

lr: 1e-3
n_iter: 50

The logged params can be visualized with dvc params:

$ dvc params diff dvclive/params.yaml

Parameters

  • name - Name of the parameter being logged.

  • val - The value to be logged.

Exceptions

  • dvclive.error.InvalidParameterType - thrown if the parameter value is not among supported types. Supported types include:

    ParamLike = Union[
        int,
        float,
        str,
        bool,
        List["ParamLike"],
        Dict[str, "ParamLike"]
    ]
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