Skip to content
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

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