Live.next_step()
Signals that the current iteration has ended and increases step
value by 1
(one).
def next_step()
Usage
from dvclive import Live
live = Live()
for step in range(3):
live.log_metric("metric", 0.9)
live.next_step()
Description
DVCLive uses step
to track the history of the metrics logged with
Live.log_metric()
.
You can use Live.next_step()
to increase the step
by 1 (one).
In addition to increasing the step
number, it will call Live.make_report()
and Live.make_summary()
.
If save_dvc_exp=True
has been passed to Live()
, Live.next_step()
will
write a dvc.yaml
file configuring what DVC will show for logged plots,
metrics, and parameters.
Manual step updates
If you want custom step
intervals or don't want to call Live.make_summary()
/ Live.make_report()
, you can manually modify the Live.step
property:
from dvclive import Live
live = Live()
for custom_step in [0, 15, 20]:
live.step = step
live.log_metric("metric_1", 0.9)
live.log_metric("metric_2", 0.7)
live.make_summary()
# Create report only at the end instead of at each iteration
live.make_report()