Edit on GitHub
Live.log_param()
def log_param(name: str, val: ParamLike):Also see Live.log_params().
Usage
from dvclive import Live
with Live() as 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: 50The logged params can be visualized with dvc params:
$ dvc params diff dvclive/params.yamlIf you use DVC pipelines, parameter dependencies are tracked automatically, and you can skip logging them with DVCLive.
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"] ]