Multiclass Neural Network Tutorial
by jens
Project Description
This project demonstrates how multiclass classification works in a neural network, and how it is different from a regular MLP that only performs binary discrimination. This project is an interactive tutorial. Please open the code and read through the comments as you click on every script to see how it works!
Instead of a single output neuron, the output layer of a multiclass classification neural network has one neuron per class. The expected target value therefore has to be a vector of all zeros with the index of the expected class activated to 1. For this there is a "vectorize (number)" function.
In order to generate an output vector that can be diffed with the target vector the output layer's response is not activated with sigmoid (or anything else) per neuron, but the whole output vector is instead activated with the softmax function, which answers a probability distribution and sums up all neurons to 1.
When using a mutliclass neural network for classifying the output vector is scanned for the index of the greatest probability. That index represents the class.
Created October 24, 2025
Last updated October 24, 2025
Published October 24, 2025