In this tutorial, I will walk you through a simple convolutional neural network to classify the images in FashionMNIST using TensorFlow. I will first set up Weights & Biases to log models metrics, then inspect the model performance, and finally, share the findings of the best architecture for the convolutional neural network used for this Image Classification problem.
To give you some context, Weights & Biases helps you keep track of your machine learning experiments. You can use the tool to log the hyper-parameters and output metrics from your runs, and then visualize and compare results and quickly share findings with your colleagues.
You can think of it as a nice alternative to Tensorboard, which is a TensorFlow extension that allows for easy model monitoring within a browser. The problem with Tensorboard is that when it is running locally, it can be hard to preserve information or share results across the team. Furthermore, you can host Tensorboard for all runs instrumented with Weights & Biases.
In this example, I will use Google Colab as a convenient hosted environment, but you can run your own training scripts from anywhere and visualize metrics with W&B’s experiment tracking tool.
Getting Started
- Open this Colab notebook.
- Click "Open in playground" to create a copy of this notebook for yourself.
- Save a copy in Google Drive for yourself.
- Step through each section below, pressing play on the code blocks to run the cells.
Results will be logged to a shared W&B project page.
Training The Model
Let’s review the key wandb commands I used in the Colab notebook above.
Setup
- pip install wandb – Installs the W&B library
- import wandb – Imports the wandb library
- wandb login – Log in to your W&B account so you can log all your metrics in one place
- wandb.init() – Initializes a new W&B run. Each run is single execution of the training script.
Initialize Hyperparameters
- wandb.config – Saves all your hyperparameters in a config object. This lets you use our app to sort and compare your runs by hyperparameter values.
Track Results
- wandb.log() – Logs your metrics so you can visualize your neural network’s performance over time.
Visualizing Results
Once you’ve trained your model, you can visualize the predictions made by your model, its training and loss, gradients, best hyper-parameters and review associated code.
To view runs created by people in this open project:
- Check out the project page.
- Expand the runs table and comparing all the results from everyone who has tried this script.
- Click on the name of a run to dive in deeper to that single run on its own run page.

Visualize Gradients
Click through to a single run to see more details about that run. For example, on this run page you can see the gradients I logged when I ran this script.

Review Code
The overview tab picks up a link to the code. In this case, it’s a link to the Google Colab I worked on. If you’re running a script from a git repo, we’ll pick up the SHA of the latest git commit and give you a link to that version of the code in your own GitHub repo.

Next Steps
You should attempt to fork this colab notebook, tweak some hyper-parameters and see if you can maximize the validation accuracy. Good luck!