Lesson 4 of 28 · AI foundations
What is a neural network?
A neural network is a computer model made of many simple connected units, called artificial neurons, arranged in layers. Each connection has a weight, a number that controls how strongly one unit influences the next. By adjusting these weights during training, the network learns to turn inputs, such as an image or a sentence, into useful outputs.
The parts of a neural network
Each artificial neuron does something very simple: it takes in a few numbers, multiplies each by a weight, adds them up and passes the result through an activation function, a small rule that decides how much signal to send on. The power comes from connecting thousands or millions of these units.
- Input layer: receives the data, such as pixel values or numbers representing words.
- Hidden layers: the layers in between, which transform the data into increasingly useful features.
- Output layer: produces the answer, such as "cat" or the next word.
- Weights and biases: the adjustable numbers that hold everything the network has learned.
How a neural network learns
Training is a loop. The network makes a guess, a loss function measures how wrong the guess was, and a method called backpropagation works out how each weight contributed to the error. Every weight is then nudged slightly in the direction that would have reduced the error, a step known as gradient descent. Repeat this over many examples and the network gradually improves.
Imagine a mixing desk with millions of knobs. After each attempt, you turn every knob a tiny bit in whichever direction makes the sound closer to the target. Frank Rosenblatt described an early single-layer network, the perceptron, in 1958, and a 1986 paper by Rumelhart, Hinton and Williams showed how backpropagation lets networks with hidden layers learn.
Is it really like a brain?
Only loosely. The name comes from biological neurons, which pass signals through connections of different strengths. But an artificial neuron is a few lines of arithmetic, and a neural network has no consciousness, feelings or goals. "Neuron" is a helpful metaphor, not a description of how the network thinks, because it does not think at all in the human sense.
Common kinds of neural networks
Different designs suit different kinds of data:
- Feedforward networks: data flows straight from input to output; good for tabular predictions.
- Convolutional networks: scan images in small patches; long the standard for computer vision.
- Recurrent networks: process sequences one step at a time; widely used for speech and text before transformers.
- Transformers: use a mechanism called attention to relate every part of the input to every other part; the basis of large language models since 2017.
Where you meet neural networks
Almost every modern AI product has a neural network inside: chat assistants, image generators, voice tools, recommendation feeds and document scanners. When you read that a model has "billions of parameters", the parameters are mostly these weights. More weights can store more patterns, but quality also depends on training data, design and tuning.
Example
One artificial neuron in Python
Code sample# One artificial neuron: should I take an umbrella?
inputs = [0.9, 0.2] # chance of rain, wind strength (0 to 1)
weights = [2.0, -0.5] # rain matters a lot; strong wind makes umbrellas less useful
bias = -0.8 # a built-in lean towards "no"
total = sum(i * w for i, w in zip(inputs, weights)) + bias
output = max(0.0, total) # ReLU activation: pass on positive signals only
print(round(output, 2)) # 0.9, a fairly strong "take it"Here the weights and bias are set by hand so you can follow the arithmetic: 0.9 × 2.0 + 0.2 × (−0.5) − 0.8 = 0.9. In a real network, training sets millions or billions of them automatically.
Key points
- A neural network is layers of simple connected units that turn numbers into numbers.
- The weights on its connections hold everything the network has learned.
- Training repeatedly nudges the weights to reduce the network's errors.
- Neural networks are inspired by the brain but are far simpler and do not think.
- Transformers, the networks behind large language models, are one family of neural network.
Try it on Mindber
Related terms
Related topics
Frequently asked questions
Why is it called a neural network?
The design was loosely inspired by neurons in the brain, which pass signals to each other through connections of different strengths. Early researchers borrowed the name. Modern artificial neural networks are mathematical models, and in detail they work very differently from biological brains.
What is a hidden layer?
A hidden layer is any layer between the input and the output. You do not see its values directly; it transforms the data into intermediate features the network finds useful, such as edges in an image. A network with many hidden layers is called deep, which is where the term deep learning comes from.
How big is a neural network?
It varies enormously. A teaching example may have a handful of weights, while the networks behind image recognition or large language models have millions to billions. Size alone does not decide quality: the training data, the design and the tuning matter just as much.
Sources
- The perceptron: A probabilistic model for information storage and organization in the brain. Frank Rosenblatt, Psychological Review, 1958
- Learning representations by back-propagating errors. Rumelhart, Hinton and Williams, Nature, October 1986
- Attention Is All You Need. Vaswani et al., arXiv, June 2017
Last updated