본문으로 건너뛰기

Level 2 project

Neural Network From Scratch

Start from the canonical project files, validate the result, and keep the evidence you need to explain what you built.

There is no upload or grading service. Run the documented validator or checks where applicable, keep the results, and score your own evidence against the rubric below. A passing check by itself does not mean the project is complete. Suggested strong-evidence target: 90/100.

Launch lesson: Neural Network Debugging Workshop

Prerequisite project: Trustworthy ML: Compare Models Without Cheating

Prerequisites

Python help for this project:

Complete Level 2 through L2.15 — Neural Network Debugging Workshop. The canonical project depends on p01-trustworthy-ml, so you should already know how to make fair train/validation comparisons and avoid leakage.

Goal

Starting from the provided scaffold, make a small XOR network learn by implementing the missing backward/update logic. Then use evidence to debug one intentional failure.

Task

  1. network.py with a two-layer forward pass and your backward/update implementation.
  2. train.py that produces a reproducible training record.
  3. A short REPORT.md that includes:
  • the shape of every parameter and activation;
  • starting and ending loss;
  • final XOR predictions;
  • one gradient check or hand-derived gradient check;
  • one intentional failure, the evidence you observed, and the fix;
  • one paragraph explaining why nonlinearity is required.
  1. The output from the submission checker.

Stuck on a TODO?

Choose one function at a time. Hint 1 offers direction, hint 2 offers pseudocode, and hint 3 reveals only that function's reference implementation after confirmation.

network.py: backward_and_step()

Try the starter function and run its validator before revealing the reference.

Hints for this TODO

Validation

Run these commands from the downloaded Project folder or the public materials repository root.

python projects/tests/l02/check_submission.py projects/starters/l02

Compare with a reference

First complete your own TODOs and run the submission validator above. Then open the published reference solution. Reference acceptance tests check the completed reference, not your submission:

python projects/tests/l02/test_reference.py

Rubric

Total: 100 points. The project measures the Level 2 exit skills directly.

CriterionPointsObservable evidence
Functional network25Two-layer NumPy network runs, preserves required shapes, reduces loss, and predicts XOR correctly under the documented seed/configuration.
Shapes and forward reasoning15Report names parameter/activation shapes and explains the forward path without relying on a framework abstraction.
Backpropagation and gradient reasoning20Backward implementation has gradients matching parameter shapes; report explains the chain from loss to parameters and includes a hand or finite-difference check.
Training choices10Learner explains batch choice, learning rate, and update rule; changes are reproducible.
Debugging15Learner creates the approved large-learning-rate failure or an equivalent intentional failure, records evidence, forms a hypothesis, fixes it, and verifies the result.
Evaluation and regularization reasoning5Learner distinguishes training objective from generalization and identifies one sensible way to detect or reduce overfitting.
Reproducibility5Seed/configuration are recorded; project runs from a clean start; checker output is included.
Communication5Explanation is clear, uses the learner's own words, and connects nonlinearity, gradients, and training evidence.

Performance anchors

Full credit

The implementation works and the explanations make cause and effect traceable. Debugging evidence shows the learner can locate a failure rather than only copy a fix.

Partial credit

The network mostly works but one exit skill is weak—for example, shapes are correct but gradient reasoning is vague, or the failure is repaired without showing evidence.

Insufficient

The submission relies on a high-level trainer/framework to hide the first-principles work, changes the canonical task, cannot reproduce its result, or presents only final predictions without explaining computation and debugging.

Self-check before you call it done

  • Can you reproduce the NumPy network's shapes, forward computations, XOR predictions, and decreasing loss?
  • Can you connect each gradient to its parameter shape and show a hand or finite-difference gradient check?
  • Can you state the batch size, learning rate, update rule, seed, and exact checker command/output?
  • Can you show an intentional failure, a focused hypothesis/fix, the verified result, and a generalization limitation?

← Back to all projects