Artificial neurons and neural networks

12 min read
A neuron multiplies inputs by weights, adds a bias, and applies an activationx₁× w₁x₂× w₂x₃× w₃inputsΣ + bweighted sumactivatione.g. ReLUoutputTraining adjusts the weights (w) and bias (b)

Neural networks are loosely inspired by the brain, but the resemblance is shallow. Think of them as flexible functions built from many tiny, identical pieces.

One artificial neuron

A neuron takes several numbers in, and produces one number out:

  1. Multiply each input by a weight (how much that input matters).
  2. Add them up, plus a bias (a baseline offset).
  3. Pass the total through an activation function.

For example, with inputs 2 and 3, weights 0.5 and −1, and bias 1: 2×0.5 + 3×(−1) + 1 = −1. Then apply the activation.

Activation functions

  • ReLU (rectified linear unit): output the number if positive, otherwise 0. Simple and the most common.
  • Sigmoid: squashes any number to between 0 and 1; useful for probabilities.
  • Softmax: turns a list of scores into probabilities that add up to 1; used on the last layer of classifiers and language models.

Without activation functions, stacking layers would collapse into one big linear equation, and the network could only draw straight lines. The non-linearity is what lets networks represent curves, edges, faces and grammar.

Layers and depth

  • Input layer: the raw data (pixel values, numbers representing words).
  • Hidden layers: neurons that transform the data. Each layer's outputs are the next layer's inputs.
  • Output layer: the prediction (a probability per class, a number, the next word).

A network with many hidden layers is deep. Depth lets networks build up hierarchies of features. In an image network, early layers detect edges, middle layers combine edges into textures and shapes, and later layers recognize eyes, wheels or faces. Nobody programs these features; they emerge from training.

How big are they?

Every connection has a weight. A small image classifier might have a million parameters. Modern LLMs have billions to trillions. The number of parameters is a rough measure of a model's capacity, though data and training matter just as much.

Why this works

Mathematicians have shown that a network with enough neurons can approximate almost any function (the universal approximation theorem). That doesn't make learning easy, but it explains why the same basic recipe works for images, sound, text and protein shapes.

Check your understanding

Check 1 of 2Module 4 · Neural networks and deep learning

Why do neural networks need non-linear activation functions?

Check 2 of 2Module 4 · Neural networks and deep learning

Which activation turns a list of scores into probabilities that sum to 1?

Answer the checks, then mark this lesson complete
Completion and scores are saved in this browser.