Create and track plots from experiments
Create and track plots from machine learning experiments.
4 minute read
Log a dictionary of metrics, media, or custom objects to a step with the W&B Python SDK. W&B collects the key-value pairs during each step and stores them in one unified dictionary each time you log data with wandb.log()
. Data logged from your script is saved locally to your machine in a directory called wandb
, then synced to the W&B cloud or your private server.
step
.Each call to wandb.log
is a new step
by default. W&B uses steps as the default x-axis when it creates charts and panels. You can optionally create and use a custom x-axis or capture a custom summary metric. For more information, see Customize log axes.
wandb.log()
to log consecutive values for each step
: 0, 1, 2, and so on. It is not possible to write to a specific history step. W&B only writes to the “current” and “next” step.W&B automatically logs the following information during a W&B Experiment:
nvidia-smi
.Turn on Code Saving in your account’s Settings page to log:
diff.patch
file if there are any uncommitted changes.requirements.txt
file will be uploaded and shown on the files tab of the run page, along with any files you save to the wandb
directory for the run.With W&B, you can decide exactly what you want to log. The following lists some commonly logged objects:
wandb.plot
with wandb.log
to track charts. See Log Plots for more information.wandb.Table
to log data to visualize and query with W&B. See Log Tables for more information.wandb.watch(model)
to see gradients of the weights as histograms in the UI.wandb.init(config=your_config_dictionary)
. See the PyTorch Integrations page for more information.wandb.log
to see metrics from your model. If you log metrics like accuracy and loss from inside your training loop, you’ll get live updating graphs in the UI.wandb.run.summary["best_accuracy"] = best_accuracy
wandb.log
, like this: wandb.log({"acc'": 0.9, "loss": 0.1})
and they will both be available to plot against in the UIwandb.log({'acc': 0.9, 'epoch': 3, 'batch': 117})
. To set the default x-axis for a given metric use Run.define_metric()wandb.log
supports the logging of a wide variety of data types, from media like images and videos to tables and charts.Create and track plots from machine learning experiments.
Use W&B to log distributed training experiments with multiple GPUs.
Log rich media, from 3D point clouds and molecules to HTML and histograms
Log tables with W&B.
Importing and logging data into W&B
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.