# Neural networks, gently · AI in Bed

Beginner level · 6 min · https://www.aiinbed.com/learn/beginner/neural-networks-gently

*Tiny calculators, wired in layers, that together can recognise a face or write a poem.*

Neural networks are loosely inspired by brains, but don't let the name intimidate you. Each "neuron" is a very simple calculator. The magic comes from wiring thousands or billions of them together.

*Figure: One artificial neuron: multiply each input by a weight, add them up with a bias, then pass the total through an activation function.*

*Interactive explainer: Play with one neuron: change the inputs, weights and bias and watch the output.*

### Weights: how much each input matters

Deciding whether to go for a run? Inputs: is it sunny, am I tired, is my friend coming.

Each input gets a **weight**. Sunshine might matter a lot (big weight), tiredness might count against it (negative weight).

### Add it up, then decide

The neuron adds up all the weighted inputs plus a **bias** (its baseline mood).

Then an **activation function** decides how strongly to "fire". A popular one, ReLU, simply says: if the total is negative, output 0; otherwise pass it through.

### Layers make it powerful

Neurons are stacked in **layers**. The first layer sees raw input (pixels), middle ("hidden") layers build up features, and the last layer gives the answer.

In an image model, early layers might detect edges, middle layers shapes like eyes, and later layers whole faces.

**Quick check:** What are a neural network's "weights"?

A. How heavy the computer is
B. Numbers that set how much each input influences a neuron
C. The number of layers
D. The training data

Answer: B. Weights are the adjustable knobs (parameters). Training is the process of finding good weights.

> Pillow thought: try it yourself tomorrow on TensorFlow Playground (link below). You can watch a tiny network learn to separate dots in your browser, no code needed.

### How big are they?

A network that reads handwritten digits might have ~100,000 weights.

Modern large language models have **billions to trillions**. Same idea, wildly bigger.

**Quick check:** Why do we need an activation function like ReLU between layers?

A. To make training slower
B. To add non-linearity, so stacked layers can learn complex patterns
C. To delete bad neurons
D. It's only for decoration

Answer: B. Without a non-linear activation, any stack of layers collapses into one simple linear function. Activations let depth actually add power.

**Key takeaways**

- A neuron = weighted sum of inputs + bias → activation function.
- Layers build from simple features up to complex ones.
- Weights are learned during training.

**Go deeper (free sources)**

- [Neural networks (chapters 1–4)](https://www.3blue1brown.com/topics/neural-networks) by 3Blue1Brown
- [TensorFlow Playground](https://playground.tensorflow.org/) by Daniel Smilkov & Shan Carter (Google)
- [Neural Networks and Deep Learning (free online book)](http://neuralnetworksanddeeplearning.com/) by Michael Nielsen
