Week 1

Stage 9 · Weeks 62–71 · deep-learning

Deep Learning + PyTorch

Build/train neural networks

Locked

Scored stage progress

0%

Practice and implementation

0/10

Exercises + milestone requirements owned by this stage

Evidence and gate

0 · 0/10

Artifacts · checked requirements

Why it matters

Purpose of this stage

Build/train neural networks

Subjects

4 subjects · 37 canonical topics

Each subject states what you should be able to do, an order to work through it in, what to watch for, and the questions a reviewer should be able to ask you at the end. None of it is tracked or scored.

How to work through this subject

An order that works, not a checklist. Nothing here is tracked — the steps sequence this subject’s own topics and add none.

  1. Work through a single neuron by hand: weights, bias, sum, activation.
  2. Stack a few of them into a layer and a couple of layers into a network, on paper.
  3. Trace one forward pass numerically on a tiny example.
  4. Compute the loss for that example and say what number you are trying to make smaller.
  5. Follow the error backwards through one layer using the chain rule from Stage 7.
  6. Describe what the optimizer does with the gradient once it has it.
  7. Finish by distinguishing batch, epoch and learning rate out loud, without conflating any two.

What to watch for

  • Backpropagation is the chain rule applied repeatedly. If Stage 7 felt shaky, revisit gradients before continuing.
  • Batch, epoch and learning rate are three different knobs. Confusing them makes training logs meaningless.
  • Without a non-linear activation, stacking layers gains you nothing — the whole network collapses to one linear step.
  • The loss must be differentiable because the entire training procedure is 'move in the direction that reduces it'.
  • Weights are what the network learns; the architecture is what you chose. Keep the two straight when something goes wrong.

Curriculum topics

perceptron intuition
The simplest unit: weigh the inputs, add a bias, apply a threshold. Everything else builds on this.
neuron
One unit computing a weighted sum of its inputs followed by an activation.
weight/bias
The learned parameters — weights scale each input, the bias shifts the result.
activation
A non-linear function applied to a neuron's output. Without it, stacking layers collapses to a single linear one.
layer
A group of neurons applied together, transforming one representation into the next.
network
Layers stacked so the output of one becomes the input of the next.
forward pass
Running inputs through the network to produce a prediction.
loss
A single number measuring how wrong the prediction was — the thing training minimises.
backpropagation
Working the loss backwards through the network with the chain rule to get each parameter's gradient.
optimizer
The rule that turns gradients into parameter updates, such as SGD or Adam.
batch
The group of examples processed together before one parameter update.
epoch
One full pass over the entire training set.
learning rate
How far each optimizer step moves the weights. The single most consequential training hyperparameter.

Resources for this subject

  • PRIMARYPyTorch — Learn the Basics PyTorch
    The official beginner path from tensors to a full training loop. Type the training loop rather than copying it — reproducing it from memory is this stage's gate.
    Open
Need another explanation?2 more references
  • REFERENCENeural Networks: Zero to Hero Andrej Karpathy
    Builds autograd and then a transformer from scratch. The single best antidote to explaining transformers as 'magic', which Stage 10's gate forbids.
    Open
  • OPTIONALDive into Deep Learning d2l.ai
    Interactive textbook with runnable PyTorch. Use for depth on a specific architecture, not as a parallel course.
    Open

A reviewer should be able to answer these

Answer from memory, out loud, before moving on. These are not tracked and do not affect the gate — they tell you whether you actually understand this subject.

  1. What does a forward pass compute, and what does a backward pass compute?
  2. What role does the activation function play, and what happens without one?
  3. What is the difference between a batch and an epoch?
  4. How does the optimizer use the gradient to change the weights?
  5. Why does the loss function have to be differentiable?
  6. What do the weight and bias of a single neuron each control?
  7. What is the learning rate scaling, and what would too large a value do to training?

Exercises

Demonstrated practice · 35% base weight
This stage defines implementation through its owned project milestone rather than a separate exercise list.

Stage project

Only milestones owned by Stage 9 count here

P6 · Stage project

Deep Learning System

Project detail

P6.M1 · PyTorch classifier

Resources

0% progress weight

Resource status is a convenience marker only. It cannot change competencies, gates, or stage completion — in any tier below.

Start here

PRIMARY

PyTorch — Learn the Basics

PyTorch

The official beginner path from tensors to a full training loop. Type the training loop rather than copying it — reproducing it from memory is this stage's gate.

Need another explanation?5 supplementary resources · not part of the canonical library

Use these for a demonstrated gap, not as a parallel course. They are authored additions and can never be the primary resource for a subject.

  • REFERENCELearn PyTorch for Deep Learning Daniel BourkeCode-first course that writes training loops out longhand — matching the gate's requirement that you recreate one without copying.Open
  • REFERENCENeural Networks: Zero to Hero Andrej KarpathyBuilds autograd and then a transformer from scratch. The single best antidote to explaining transformers as 'magic', which Stage 10's gate forbids.Open
  • OPTIONALDive into Deep Learning d2l.aiInteractive textbook with runnable PyTorch. Use for depth on a specific architecture, not as a parallel course.Open
  • REFERENCEReproducibility PyTorchWhat you must control to make a training run repeatable, and what stays nondeterministic anyway. Required for a credible experiment log.Open
  • OPTIONALTensorBoard TensorFlowWorks with PyTorch and renders the learning curves the Stage 9 project requires. A plotted curve you read is enough — the tool is optional.Open

Stage gate

Readiness assessment

Not ready

Stage-specific requirements

Answer each prompt without notes. Expand a question only when you are ready to check your answer.
0/2
  • Recreate a basic PyTorch training loop
    No copy/pasted training loop.
    Answer

    Written from memory: build the DataLoader, then for each batch zero the gradients, run the forward pass, compute the loss, call backward, and step the optimizer. Wrap the epoch loop around it and add an evaluation pass in evaluation mode without gradient tracking. Nothing in that sequence should need to be looked up.

  • Explain each line of the training loop
    Answer

    Zeroing gradients prevents accumulation from the previous iteration. The forward pass computes predictions while autograd records the operations. The loss reduces those predictions and targets to one differentiable number. Backward computes the gradient of that number with respect to every parameter. The optimizer step applies those gradients according to its rule and learning rate. Evaluation mode changes layers that behave differently in training, and disabling gradient tracking stops recording work you will not backpropagate.

Universal requirements

The eight conditions 01_LEARNING_RULES.md applies to every stage. Expand one to see what it actually asks for.
0/8
  • Core concepts can be explained from memory.
    What this asks for

    Every subject in this stage has review questions. The condition is met when you can answer them out loud, without notes and without looking anything up, in your own words rather than a recited definition. An explanation you can only give with the material open is recognition, not recall.

  • Required exercises are complete.
    What this asks for

    Complete means each exercise satisfies its stated requirements and its done-when criteria, not that you attempted it. Where an exercise says you should be able to explain or defend something, that explanation is part of completing it. A stage whose source lists no exercises meets this through its owned project milestone instead.

  • Stage project works.
    What this asks for

    Works means it runs end to end from a clean checkout, on the inputs it was built for, with the failure cases it claims to handle actually handled. It is not a notebook that produced a result once. Someone else following your README should be able to run it without asking you a question.

  • Tests or verification exist.
    What this asks for

    There is something that would fail if the behaviour regressed, and you have watched it fail. That can be automated tests or a written verification procedure with recorded results, depending on what the stage produces. A test that has only ever passed is evidence of nothing.

  • README explains decisions.
    What this asks for

    The README says what the project is, how to install, run and test it, and why it is built the way it is: the choices you made, the alternatives you rejected, and what you deliberately left out. A list of commands with no reasoning does not meet this condition.

  • You can reproduce the core implementation without copying.
    What this asks for

    Delete the central piece and write it again from an empty file, without your previous version, a tutorial, or generated code in front of you. It does not have to be identical, it has to work and you have to be able to explain every line. This is the condition that separates having finished from being able.

  • You pass the stage self-assessment at >= 80%.
    What this asks for

    Record a gate exam and score yourself honestly against the dimensions the roadmap defines: recall, implementation, debugging, testing and design judgment. Elapsed time, hours watched and completed resources count for nothing here. Checking the boxes without a recorded exam does not open the gate.

  • Claude/ChatGPT reviewer finds no foundational blocker.
    What this asks for

    Ask an AI reviewer to examine the work against this stage's concepts and report foundational misunderstandings, not style. A foundational blocker is a misconception that later stages would build on, such as leakage, a broken abstraction, or an explanation that is confidently wrong. Nothing in that class may remain open when you pass.

Recorded exam

No exam recorded. Checking every requirement is not sufficient.

Evidence

Artifacts linked to this stage

Add evidence
No stage evidence yet.