Edit on GitHub
Fast.ai
DVCLive allows you to add experiment tracking capabilities to your Fast.ai projects.
Usage
Include the
DVCLiveCallback
in the callbacks list passed to your
Learner:
from dvclive.fastai import DVCLiveCallback
...
learn = tabular_learner(data_loader, metrics=accuracy)
learn.fit_one_cycle(
n_epoch=2,
cbs=[DVCLiveCallback()])Each metric will be logged to:
{Live.plots_dir}/metrics/{split}/{metric}.tsvWhere:
{Live.plots_dir}is defined inLive.{split}can be eithertrainoreval.{metric}is the name provided by the framework.
Parameters
-
live- (Noneby default) - OptionalLiveinstance. IfNone, a new instance will be created using**kwargs. -
**kwargs- Any additional arguments will be used to instantiate a newLiveinstance. Ifliveis used, the arguments are ignored.
Examples
- Using
liveto pass an existingLiveinstance.
from dvclive import Live
from dvclive.fastai import DVCLiveCallback
with Live("custom_dir") as live:
learn = tabular_learner(data_loader, metrics=accuracy)
learn.fit_one_cycle(
n_epoch=2,
cbs=[DVCLiveCallback(live=live)])
# Log additional metrics after training
live.log_metric("summary_metric", 1.0, plot=False)- Using
**kwargsto customize the newLiveinstance.
learn.fit_one_cycle(
n_epoch=2,
cbs=[DVCLiveCallback(dir="custom_dir")])