Edit on GitHub

dvclive.set_step()

Signals that the current step has ended and sets step to the given value.

def set_step(step: int):

Usage:

from dvclive import Live

live = Live()

for step in [0, 10, 20]:
    live.set_step(step)
    live.log("metric_1", 0.9)
    live.log("metric_2", 0.7)

Description

DVCLive uses the step value to track the progress of each metric logged with Live.log(). You can use Live.set_step() to set step to any value.

Each metric logged in between Live.set_step() (or Live.next_step()) calls will be associated to the provided step value.

DVC integration

When dvclive is used alongside DVC, each Live.set_step() call will have additional effects.

By default, on each Live.set_step() call, DVC will prepare an HTML report with all the metrics logs logged in path.

In addition, when checkpoints are enabled in the pipeline, DVC will create a new checkpoint on each Live.set_step() call.

Example

Given the Usage code snippet above, the metrics logs generated for metric_1 would be:

$ cat dvclive/metric_1.tsv
timestamp	step	metric_1
1614129197192	0	0.9
1614129198031   10	0.9
1614129198848	20	0.9
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