# Perceptrons and Multilayer Networks

> From a single neuron to stacked layers: weights, biases, forward passes and why depth plus nonlinearity makes networks expressive. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/machine-learning/neural-networks-basics
Last updated: 2026-11-28

From a single neuron to stacked layers: weights, biases, forward passes and why depth plus nonlinearity makes networks expressive.

Intermediate · about 5 hours · difficulty 3/5

Learn first: [Logistic Regression and Linear Classifiers](https://www.internhack.in/roadmaps/tracks/machine-learning/logistic-regression), [Calculus and Gradients](https://www.internhack.in/roadmaps/tracks/machine-learning/calculus-gradients)

A neuron computes a weighted sum of its inputs plus a bias, then applies a nonlinear activation. A **multilayer perceptron (MLP)** stacks layers of neurons so each layer transforms the previous one's output.

### Core ideas

- **The perceptron** is a linear classifier; logistic regression is essentially a single neuron with a sigmoid.
- **Layers as matrix multiplies**: `h = activation(W @ x + b)`. A batch of inputs is a matrix, so a layer is one matrix product.
- **Why nonlinearity**: without it, stacked linear layers collapse into one linear layer.
- **Universal approximation**: a wide enough network can approximate any function, but depth makes learning efficient.
- **Representation learning**: hidden layers learn features automatically instead of you engineering them.

### When neural networks win

Unstructured data (images, text, audio) and very large datasets. On small or medium tabular data, gradient boosting still usually wins.

**Good enough to move on** when you can implement the forward pass of a two-layer MLP in NumPy and explain every shape along the way.

## Key concepts

- **Perceptron**
- **Neurons, weights and biases**
- **Layers as matrix multiplication**
- **Why nonlinearity matters**
- **Universal approximation**

## Mini project

Build a two-layer MLP forward pass in NumPy and experiment in TensorFlow Playground to find the smallest network that separates the spiral dataset.

## Check yourself

Why does a network of ten linear layers with no activations have the same power as a single linear layer?

## Free resources

- [Neural Networks series](https://www.3blue1brown.com/topics/neural-networks) (3Blue1Brown)
- [TensorFlow Playground](https://playground.tensorflow.org/) (TensorFlow)
- [Dive into Deep Learning](https://d2l.ai/) (d2l.ai)

Previous: [Anomaly and Outlier Detection](https://www.internhack.in/roadmaps/tracks/machine-learning/anomaly-detection) · Next: [Backpropagation and Autograd](https://www.internhack.in/roadmaps/tracks/machine-learning/backpropagation)

## More in Neural Network Fundamentals

- [Perceptrons and Multilayer Networks](https://www.internhack.in/roadmaps/tracks/machine-learning/neural-networks-basics)
- [Backpropagation and Autograd](https://www.internhack.in/roadmaps/tracks/machine-learning/backpropagation)
- [Activation and Loss Functions](https://www.internhack.in/roadmaps/tracks/machine-learning/activations-and-losses)
- [Optimizers and Learning Rate Schedules](https://www.internhack.in/roadmaps/tracks/machine-learning/deep-learning-optimizers)
- [Regularization, Initialization and Normalization](https://www.internhack.in/roadmaps/tracks/machine-learning/regularization-and-normalization)
- [Debugging and Running Training Experiments](https://www.internhack.in/roadmaps/tracks/machine-learning/training-debugging)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Machine Learning Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/machine-learning)
