Edit on GitHub

Live.log_params()

def log_params(params: Dict[ParamLike]):

Also see Live.log_param().

Usage

from dvclive import Live

live = Live()

params = {
    "num_classes": 10,
    "metrics": ["accuracy", "mae"],
    "training": {
        "epochs": 42,
        "batch_size": 128,
        "optimizer": {
            "name": "adam",
            "loss": "categorical_crossentropy",
            "learning_rate": 1e-3,
        },
    },
}
live.log_params(params)

Description

On each Live.log_params(params) call, DVCLive will write keys/values pairs in the params dict to {Live.dir}/params.yaml:

lr: 1e-3
n_iter: 50

The logged params can be visualized with dvc params:

dvc params diff dvclive/params.yaml

If you use DVC pipelines, parameter dependencies are tracked automatically, and you can skip logging them with DVCLive.

Parameters

  • params - dictionary with name/value pairs of parameters to be logged.

Exceptions

  • dvclive.error.InvalidParameterType - thrown if any of the parameter values in the params dict 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