
Hidden Layers and Output Layers
Chaining a hidden layer into an output layer with superscript notation to weigh intermediate hidden activations and produce a single final prediction.
In Topic 3, we grouped three artificial neurons into a single layer to evaluate a movie script across three questions in parallel:
Feeding our 4-dimensional script vector ([Action, Romance, Comedy, Sci-Fi]) through that layer produced a 3-dimensional activation vector —giving the studio three separate evaluations for Commercial Hit, Oscar Potential, and International Appeal:
However, as we saw at the end of Topic 3, stopping here leaves the studio with an unresolved problem: three separate numbers are not a single final output.
- 'Die Hard in Space' scored high on Commercial Hit and International Appeal, but failed on Oscar Potential.
- 'The Notebook 2' failed on Commercial Hit, but succeeded on Oscar Potential and broke even on International Appeal.
A movie studio cannot greenlight two-thirds of a movie. The scores must be weighed against one another to produce a single prediction for Greenlight vs. Reject.
Because neurons within a single layer operate independently, none of the three neurons can see what the other two computed. To weigh those three intermediate scores and combine them into one final output, we need a second layer.
Stacking a Second Layer
Look closely at what our first layer produced: an ordered column vector of three numbers ().
We already have the mathematical component designed to take a vector of numbers, weigh each entry by how much it matters, add a bias, and produce a single score: another artificial neuron.
Instead of placing a fourth neuron along with the first three (which would only evaluate the inputs from a fourth angle), we place a new neuron after the first layer. The 3 outputs of Layer 1 become the 3 inputs to Layer 2:

By wiring the layers in sequence, each layer takes on a distinct role in the pipeline:
- Layer 1 (3 Neurons): Reads the 4 raw script features (
[Action, Romance, Comedy, Sci-Fi]) and computes 3 intermediate scores ([Hit, Oscar, International]). - Layer 2 (1 Neuron): Reads those 3 intermediate scores as its inputs, weighs their relative importance to the studio, and computes 1 final output.
Hidden Layers vs. The Output Layer
Once we stack a second layer onto our network, we distinguish between two types of layers based on where they sit in the pipeline:
1. The Output Layer
The final layer at the end of a neural network is called the Output Layer. Its job is to compute the model's final output.
In our studio model, Layer 2 is the Output Layer. Because the studio wants a single binary prediction (Greenlight vs. Reject), this layer contains just 1 neuron.
To clearly distinguish the network's final prediction from internal intermediate scores, standard machine learning notation writes the output of the final layer as (pronounced "y-hat").
2. The Hidden Layer
Before we added Layer 2, our three neurons in Layer 1 were the final output of the model. Now, Layer 1 is sandwiched between the raw input vector () and the Output Layer.
Any layer that sits between the input and the final output is called a Hidden Layer. While the Output Layer's final prediction is written as , a hidden layer's output continues to be written as an activation vector ().
Stepping into a hidden layer also changes how we think about what a neuron represents. Up to now, we called each neuron a "question" or a "criterion" because our single layer was the final output. In a multi-layer network, a hidden neuron represents a factor that plays a part in the final output of the model.
NOTE: Why Is It Called "Hidden"?
A Hidden Layer is not "hidden" because the math is secret or unobservable—as you will see across this topic, we can inspect and calculate every single number inside it by hand.
It is called hidden because from the perspective of someone using the finished system, only the Input () going in and the Final Prediction coming out are visible. Every layer in between operates behind the scenes as an internal stepping stone.
Layer Superscript Notation
In a single-layer model, writing , , , and was unambiguous because there was only one layer.
In a multi-layer network, every layer has its own weight matrix, its own bias vector, its own linear scores, and its own activations. To keep track of which layer a variable belongs to, neural networks attach a superscript in parentheses—such as for Layer 1 and for Layer 2:
- Layer 1 (Hidden Layer): Weight matrix , bias vector , linear score vector , and hidden activation vector .
- Layer 2 (Output Layer): Weight matrix , bias vector , linear score vector , and final prediction (the output activation ).
NOTE: Superscripts in Parentheses Are Labels, Not Exponents
Standard exponents have no parentheses ( means ).
A number inside parentheses in a superscript—like or —never means squaring a number. It is strictly an index label meaning "belonging to Layer 2."
With this notation in place, look at the linear step for both layers side by side. In every layer, the operation is identical—multiply the incoming input by the layer's weight matrix and add the layer's bias:
Notice how the inputs behave across the two equations:
- Why is inside Layer 2's equation? In , every term wears a except . That is because a layer never has a separate input variable of its own—the input to any layer is always the output from the previous layer. Layer 2's incoming input is literally Layer 1's output ().
- Why does Layer 1 multiply by instead of an ? Because Layer 1 is the very first layer of neurons, its "previous layer" is simply the raw input vector itself. In neural network terminology, the raw input is often called the Input Layer (or Layer 0, sometimes written as in textbooks so that every layer follows the exact same pattern).
No matter how many layers we stack into a network, every layer repeats this exact same relay: take the output vector from the layer before it, multiply by its own weight matrix, and add its own bias.