← Learning Hub
Advanced

Neural Networks and Deep Learning

A neural network is made of layers of tiny units ("neurons"). Each unit multiplies its inputs by weights, adds them up and passes the result through a simple function. Training nudges the weights again and again to reduce the error.

Neural networks learn by adjusting millions of small weights to reduce their errors. With enough layers and data, they can recognise images, speech and language - the technology behind today's AI boom. For many table-data problems, though, simpler models are just as good and much cheaper.

Example
You can edit this code.

A small network with scikit-learn

Example
You can edit this code.

Deep learning

  • Deep = many layers. Early layers find simple patterns (edges), later ones complex things (faces, words)
  • Real deep learning uses PyTorch or TensorFlow, and GPUs for speed
  • CNNs are good at images; Transformers power language models like Claude and ChatGPT
  • They need lots of data and computing power - for table data, random forests are often just as good and much cheaper
Key points
  • A neuron computes a weighted sum and an activation.
  • Training adjusts weights to reduce error.
  • Deep learning uses many layers; Transformers power LLMs.

📝 Test yourself

1. What does training change in a neural network?
2. Which architecture powers modern language models?
3. Fill in the scikit-learn neural network classifier:
from sklearn.neural_network import