Skip to content

Instantly share code, notes, and snippets.

@dacbd
Created August 16, 2023 18:01
Show Gist options
  • Save dacbd/7d6d369c57d345926ecfca95577acd4d to your computer and use it in GitHub Desktop.
Save dacbd/7d6d369c57d345926ecfca95577acd4d to your computer and use it in GitHub Desktop.
dvc-pipeline-base
stages:
train:
cmd: python train.py
params:
- params.yaml:
metrics:
- dvclive/metrics.json:
cache: false
plots:
- dvclive/plots:
cache: false
epochs: 8
sleep: 4
import random
import time
from dvclive import Live
from dvc.api import params_show
params = params_show()
time.sleep(1)
with Live(save_dvc_exp=True) as live:
time.sleep(params["sleep"])
for i in range(params["epochs"]):
print(f"training on epoch: {i}")
live.log_metric("foo", i + random.random())
live.log_metric("bar", params["epochs"] - (i + random.random()))
live.next_step()
time.sleep(params["sleep"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment