Introduction

A multilayer perceptron, or MLP, is the first complete neural network architecture in this path.

It takes the pieces we already built:

  • tensors and shapes;
  • models as functions;
  • linear scores;
  • nonlinear activations.

Then it composes them into layers.

inputhidden layeroutputx1x2x3h1h2h3h4s1s2input -> hidden activations -> scores
An MLP composes layers: input features become hidden activations, then outputs.

An MLP is not mysterious. It is a sequence of affine maps and activations. The hidden layers transform the input into intermediate representations. The final layer turns that representation into predictions.

By the end of this chapter, you should be able to trace a small MLP forward pass, name the role of each layer, and explain why hidden representations come before prediction.