Quickstart
Use Weights & Biases for machine learning experiment tracking, dataset versioning, and project collaboration.
To get started, just pip install the package and log using wandb.login()
If this is your first time using wandb, you'll need to sign up. It's easy!
What's a config for?
Set wandb.config
once at the beginning of your script to save your training configuration: hyperparameters, input settings like dataset name or model type, and include any other independent variables or metadata for your experiments.
Why does that matter?
This is useful for analyzing your experiments and reproducing your work in the future. You'll be able to group by config values in our web interface, comparing the settings of different runs and seeing how these affect the output.
Note that output metrics or dependent variables (like loss and accuracy) should be saved with
wandb.loginstead.
How do I set up a config?
Your config should be set just once at the beginning of your training experiment.
But workflows differ, so we offer a number of ways to set up your config.
Let's look at all the ways you can create and send the config dictionary to the Dashboard!
Setting the config at initialization
The best time to set the config values is when you call wandb.init,
by passing a dictionary as the config keyword argument.
Head to the Run page
linked in the output of wandb.init
and head to the Overview tab
(top of the list of panels on the left-most side of the screen).
You'll see a "Config" section that looks like this:

You give us a (possibly nested) dictionary as your config, and we'll flatten the names using dots in our backend.
Side Note: We recommend that you avoid using dots in your config variable names, and use a dash or underscore instead. Once you've created your
configdictionary, if your script accesseswandb.configkeys below the root, use the dictionary access syntax,["key"]["foo"], instead of the attribute access syntax,config.key.foo.
Adding to the config by hand
You can add more parameters to the config later if you want:
Now, your Config section on the dashboard has been updated:

Adding to the config with argparse
config is a dictionary-like object, and it can be built from lots of dictionary-like objects.
For example, you can pass in the arguments object produced by argparse.
argparse, short for argument parser, is a standard library module in Python 3.2 and above that makes it easy to write scripts that take advantage of all the flexibility and power of command line arguments. And it's Pythonic!
This is especially convenient for tracking results from scripts that are launched from the command line.
Here's the updated Config panel:

Updating the config with the API
What if your run has finished, but you realized you forgot to log something?
Never fear, you can always use the
public API
to update your config
(or anything else about your run!)
at any time. You just need to know the details of the run you want to update.
Here's what the final Config panel looks like:

Using config for great good!
The config parameters are useful for performing grouping, filtering, and aggregating on your experiments and their results.
The examples below come from the project here.
Filtering Runs
Filter tab allows you to display the runs that quality one or more conditions. These conditions can be formed by applying relational operators to any of the parameters logged in the config file.
Our example project compares various hyper-parameter tuning methods and has more than 80 runs. Each run has a "Job Type" logged in the config which corresponds
Let's say you want to visualize only the ones that are generated by a particular tuning algorithm, like Population Based Traing (pbt). You can do that by applying a filter on "Job Type".
Run the cell below to see this in action!
Grouping Runs
You can group your experiments in the dashboard of your project based on a particular column from config. A common use case for this would be grouping sub-experiments within a larger project.
Our runs are grouped based on "Job Type". The Group tab is located next to the Filter Tab. You can group your runs by any parameter present in the config.

Parallel Coordinates Chart
Often, the main thing we want to do with a group of Runs is make comparisons.
The W&B Dashboard includes a Chart type for exactly this purpose: the Parallel Coordinates chart.
A Parallel Coordinates chart represents each Run in the group as a line.
This line passes through as many of the config values
or logged metrics as you like,
and is colored by its value on a single metric.
This lets you take in, at a glance,
which hyperparameter configurations were most and least successful.
See the example below.
Head to a group of Runs in this project and build a Parallel Coordinates chart like the one pictured below by
- clicking the + sign in the top-right corner, aligned with "Charts",
- selecting "Parallel Coordinates" from the available Charts, and
- adding the columns in the image, in order.
