Confusion Matrix Tensorboard

In this article I’ll explain how you can create a confusion matrix with TensorBoard and PyTroch. At the end of this article you will find the link to this code on my GITHub. If you need a confustion matrix without TensorBoard you can jump to the following tutorial here:

Let’s start and load the data:

Loading the FashionMNIST datatset.

The confusion Matrix:

The Conv-Net:

This is a simple architecture of a Conv-Net. Not fancy but it works!

Convolutional Neural Network.

Train the data:

Feed the Conv-Net with the data. Reduce the epochs if you have a slow CPU.


Object detection takes no longer than a coffee.
Object detection takes no longer than a coffee.

A short tutorial that shows you how to do realtime object detection with Pytorch with a pretrained Faster R-CNN model. The model is trained with the COCO dataset.
My recommendation is that you should run that code on a NVIDIA card. Otherwise, object detection slows down.

Before you start!

Grab a coffee and start coding!


This is a short tutorial on how to create a confusion matrix in PyTorch. I’ve often seen people have trouble creating a confusion matrix. But this is a helpful metric to see how well each class performs in your dataset. It can help you find problems between classes.

Confusion Matrix MNIST-FASHION dataset
Confusion Matrix MNIST-FASHION dataset
Confusion Matrix MNIST-FASHION dataset

If you were only interested in coding the matrix. Jump directly to “Build confusion matrix” at the end of this article. You will also find the link to my code on GITHub at the end.

If you want to use Tensorboard instead go to:

For all others… first things first. Let’s start…


How do you cross the bridge in Software Support?

Hey my name is Christian Bernecker and I working for IBM. In my early days I worked as an Technical L2 Support Agent. In these days I faced that triaging tickets, bugs, incident reports are a big problem and still be handled by humans. My first thought was that this is a really inefficient way. Because some high skilled engineers looking over each new incoming ticket and they try to find the right person to solve the problem.

I’d like to take you with me on my journey how I implemented an automated bug triaging system for IBM. This system…


In real world examples you often have to deal with typos and misspelled words. This is a big problem for the most people that are new to Data Science. In this article I’ll show you how you can solve this problem.

Why Keywords?

In the Data Science community it is often useful to filter documents based on keywords. These keywords could be extracted from previous analysis or they could be provided by knowledge/domain experts. The following example shows you a list of keywords to filter performance problems.

keywords = [“100% CPU”, “CPU starvation”,”crash”,”hang”,”hanging thread”, “heap dump”, “Heapdump”, “high CPU”, “hung thread”,
“memory leak”,”OOM”,”Out…


This is a short demo how can you synchronize in-memory objects over multiple instances in an IBM CLOUD Cloud Foundry App. When you use multiple instances in a IBM Cloud Foundry App (CF) and you use lists, arrays or objects to cache information in the memory you have to be careful with the refreshment of the cache. Because if you use an API Call to refresh the cache. Only the instances that the request hit will be updated. All others stay in the same condition as before. Because they don’t share the memory across the instances. That means each instance…

Christian Bernecker

Software Developer and Data Scientist

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store