Privacy note: We capture your IP address to provide customised and focused services. See our Privacy Policy.

Deep Learning & Neural Networks — Alpha School

Lesson 1: What Is Deep Learning — and What It Is Not

Deep learning is a way of teaching computers to recognise patterns by showing them many examples, rather than by writing down every rule by hand. A traditional program follows instructions a person wrote: if the picture has a round shape and two dots, call it a face. A deep learning system instead looks at thousands of labelled pictures and adjusts itself until it can tell faces from other things on its own. The rules it ends up using are learned from the data, not typed in by a programmer.

The word deep refers to depth: these systems are built from many layers stacked on top of each other. Each layer transforms its input a little, and the layers together build up from simple details to complex ideas. In a picture, the first layer might react to edges and contrasts, the next to shapes such as circles and corners, and a later layer to whole objects such as eyes or wheels. No single layer understands the picture; the understanding emerges from the whole stack working together.

Where Deep Learning Works Well

Deep learning shines when the task is hard to describe with rules but easy to show with examples. Recognising speech, translating between languages, reading handwriting, spotting a tumour in a scan, and recommending a film are all tasks where examples are plentiful and the pattern is subtle. In each case, a person finds it hard to explain exactly how they do the task — you know a cat when you see one, but you cannot list the exact measurements that make it a cat — yet a system trained on many examples can learn the pattern anyway.

It is equally important to know where deep learning does not fit. When you have only a handful of examples, when the rules are already clear and exact, or when a wrong answer would be dangerous and must be explained step by step, a simpler method is usually better. A spreadsheet formula beats a neural network for calculating tax, and a short checklist beats one for landing a plane. Deep learning is a powerful tool, not a replacement for careful thinking about which tool a problem needs.

Learning, Not Magic

A trained network is not intelligent in the human sense. It does not understand what a cat is, want anything, or know when it is wrong. It is a large collection of numbers, tuned by training, that maps inputs to outputs. When it works well, that is because the training data covered the cases it meets; when it meets something very different from its training data, it can fail confidently and strangely. Keeping that picture in mind — a pattern-matching machine, not a mind — will protect you from both over-trusting it and underestimating what it can do.

In this course you will build that picture piece by piece. You will learn what a neuron computes, how a network learns from its mistakes, how to train a real network in Python, and how the same ideas stretch to images and language. Along the way you will also learn the limits: how to test a model honestly, how to spot when it has memorised instead of learned, and how to deploy it responsibly. By the final capstone you will have trained, evaluated and presented a model of your own.

Deep Learning in Everyday Life

You have probably already used deep learning today without noticing. When your phone unlocks by recognising your face, when a keyboard suggests the next word, when a photo app groups pictures of the same person, or when a streaming service recommends a film, a trained network is doing the pattern-matching behind the scenes. None of these systems was programmed with rules for faces or taste; each was trained on many examples until it could generalise. That is why the same technology appears in so many different products: once you can learn patterns from examples, the same recipe applies to images, sound, text and sensor readings alike.

It is also worth noticing what these everyday systems have in common: they all make mistakes, and their makers design around that fact. A face unlock that fails simply asks for a PIN; a recommendation that misses the mark costs nothing; a keyboard suggestion you ignore is harmless. The systems that succeed in daily life are the ones where the cost of being wrong is low, or where a human is there to catch the error. As you build your own models later in this course, ask the same question about each one: what happens when it is wrong, and who notices?

Key Terms

Deep learning
Machine learning that uses neural networks with many layers to learn patterns from examples.
Neural network
A system of connected units, organised in layers, that transforms inputs into outputs.
Training data
Labelled examples a model learns from during training.
Layer
One stage of a network; each layer transforms the numbers it receives from the layer before.
Pattern recognition
Finding regular structure in data, such as the shapes that mark a handwritten digit.
Model
The trained system — its structure plus the numbers it learned — used to make predictions.
Label
The correct answer attached to a training example, such as the word 'cat' on a photo of a cat.

Discussion Questions

  1. Think of something you can recognise instantly but cannot explain with rules — a friend's voice, a familiar smell. Why is that kind of task a good fit for learning from examples?
  2. Where in your own school or daily life would a rule-based program beat a deep learning system? Why?
  3. If a network can be confidently wrong, what should a person check before acting on its output?

Practice Questions

  1. In one sentence, what does deep mean in deep learning?
  2. Give one task deep learning suits well and one it suits badly, with a reason for each.
  3. What does a network actually learn during training?
  4. Why might a network fail on a new example even after training well?
  5. What is the difference between a model and its training data?
Show answers
  1. It means the network has many layers stacked on top of each other. Depth is the number of layers, and each layer builds on the one before it.
  2. Well suited: recognising handwritten digits — examples are plentiful and the rules are hard to write down. Badly suited: calculating tax — the rules are exact and a formula is more reliable. The key is whether examples or exact rules describe the task better.
  3. It learns numbers — weights and biases — that make its outputs match the labels on its training examples. It does not learn rules written in words, and it does not gain understanding.
  4. Because the new example is unlike anything in its training data. A network only knows the patterns its training examples showed it.
  5. The training data is the set of labelled examples used to teach; the model is the trained system that can then make predictions on new inputs. The data is the lesson; the model is what was learned.
Keep reading to complete this lesson