Week 8 · Sunday — consolidate and defend
Neural project defense and a new debugging case (Day 40 extended assessment)
- 90 minsession length
- 4timed blocks
- 5tasks
- —status
Session plan90 min
Before you start
Before the session: Saturday's ablation CSV, test comparison, figures and result note; a report file with headings
already created. For the transfer task, copy the code from the transfer section into a new file
transfer/w08_case.py outside your project code. It uses numpy and scikit-learn only, synthetic data, no network
access, and runs in a few seconds on a laptop CPU.
Blocks4
Block 1: Spaced recall
20 minCumulative, closed notes, covering Days 31-39; then self-check and correct:
- Output size of a convolution on a 28x28 input with a 3x3 kernel, stride 1 and padding 1; then with stride 2 and no padding. Number of weights in that layer for 1 input channel and 16 filters (with biases).
- Why gradients through many recurrent time steps can vanish or explode, and what gating changes.
- Cosine similarity of two embedding vectors you write down, and one reason a high similarity can mislead in a specialised domain.
- Shapes of Q, K, V and the attention-weight matrix for 3 tokens with d_k = 2, and what the softmax is taken over.
- From Week 7: the curve pattern you diagnosed last Sunday and the intervention you tested.
Correct each miss and tag it; repeat last week's single-weight teach-back here if it was skipped.
Block 2: Transfer case and report completion
40 minFirst 20 minutes - unaided transfer debugging case (assessment). Work the transfer task below without looking at your Week 7-8 code or the reference implementation. Record your hypotheses in order, the checks you ran, and the evidence each check produced.
Next 20 minutes - finish the neural report draft. Expand your Saturday notes into a report of about 500-800 words plus the computed tables and figures: question and dataset, split and metric, baseline, network and checks (shapes, gradient check, tiny-batch overfit), the ablation with seed spread, the single test comparison, error and learning-curve comparison, limitations, and a decision (would you deploy the network, the baseline, or neither, for what use, and what evidence would change that). Final polish happens in the Week 12 portfolio session; the conclusions must be complete today.
Block 3: Teach-back and decision defense
20 minDefend two things aloud or in writing (about 250 words in total):
- Architecture relevance. For your dataset, and for two new situations of your choice from different sectors (for example sensor time series in manufacturing, or free-text complaints in insurance), say whether a CNN, a recurrent model, an attention-based model, or a classical model is the sensible first candidate, what inductive bias justifies it, and what the classical baseline would be.
- Report conclusion. What your comparison proves, what it does not prove (one dataset, one split, a few seeds, CPU-scale model), and the cheapest next experiment that could overturn it.
Block 4: Weekly review and planning
10 minClose the neural thread for now: list the artefacts that exist, the limitations still open, and anything that moves to the Week 12 portfolio session. Set the Week 9 priority: preparing the retrieval corpus and the labelled query set. Note your transfer-case result honestly in the weekly log.
Tasks5
Task 1
recallAnswer the Days 31-39 recall set (convolution output shape and parameter count, recurrent gradient path, cosine similarity caveat, attention shapes, last week's diagnosis) and correct misses.
Task 2
analysisSolve the transfer debugging case unaided: locate the fault, prove it with evidence, give the corrected comparison, and name the check that would have caught it before anyone drew a conclusion.
Task 3
writingComplete the 500-800 word neural report with tables and figures from your executed runs, including limitations and a deployment decision.
Task 4
defenseDefend which architecture family (CNN, recurrent, attention-based, or classical) is a sensible first candidate for your dataset and two new cross-sector situations, and what your own comparison does and does not prove.
Task 5
writingRecord the neural-thread artefact inventory, open limitations, and the Week 9 priority.
Transfer task
Constructed debugging case (synthetic data; this record states no results - run it yourself). A colleague trained a small network to predict a synthetic "late-booking share" from two synthetic features (days before departure and fare relative to the route median). They report that the network's logged MSE stops improving and stays far above the linear-regression baseline, and they propose increasing the hidden layer to 128 units and training ten times longer. Before agreeing, investigate.
import numpy as np
from sklearn.linear_model import LinearRegression
rng = np.random.default_rng(8)
n = 2000
days_out = rng.uniform(0, 90, n) # synthetic: days before departure
fare_idx = rng.uniform(0.6, 1.6, n) # synthetic: fare relative to route median
X = np.column_stack([days_out, fare_idx])
y = 0.9 * np.exp(-days_out / 25) - 0.25 * (fare_idx - 1.0) ** 2 + rng.normal(0, 0.03, n)
idx = rng.permutation(n)
tr, va = idx[:1500], idx[1500:]
mu, sd = X[tr].mean(0), X[tr].std(0)
Xs = (X - mu) / sd
def mse(pred, target):
return float(np.mean((pred - target) ** 2))
W1 = rng.normal(0, 0.5, (2, 16)); b1 = np.zeros(16)
W2 = rng.normal(0, 0.5, (16, 1)); b2 = np.zeros(1)
y_tr = y[tr].reshape(-1, 1)
lr = 0.05
for epoch in range(301):
h = np.maximum(0, Xs[tr] @ W1 + b1)
pred = h @ W2 + b2
g = 2 * (pred - y_tr) / len(tr)
gW2, gb2 = h.T @ g, g.sum(0)
gh = (g @ W2.T) * (h > 0)
gW1, gb1 = Xs[tr].T @ gh, gh.sum(0)
W1 -= lr * gW1; b1 -= lr * gb1; W2 -= lr * gW2; b2 -= lr * gb2
if epoch % 50 == 0:
pred_va = np.maximum(0, Xs[va] @ W1 + b1) @ W2 + b2
print(f"epoch {epoch:3d} train_mse {mse(pred, y[tr]):.4f} val_mse {mse(pred_va, y[va]):.4f}")
lin = LinearRegression().fit(Xs[tr], y[tr])
print(f"linear baseline val_mse {mse(lin.predict(Xs[va]), y[va]):.4f}")
Deliver, in order:
- Your first two hypotheses, written before running anything, and which check you will run first and why.
- The fault: where it is, the printed shape or value that proves it, and why Python raised no error.
- The corrected train and validation MSE from your own re-run, next to the baseline, and what the comparison now shows (single seed, synthetic data, validation only).
- Your answer to the colleague's proposal: accept or reject, with the evidence.
- One guard you would add to the training code so this class of fault fails loudly, and which of your own Week 7-8 checks would or would not have caught it.
Rubric4 criteria
| Criterion | Meets | Exceeds |
|---|---|---|
| Transfer debugging | Locates the fault with a printed shape or value as evidence, re-runs with the fix, and reports the corrected comparison against the baseline. | Explains why the error was silent rather than raising an exception, and adds a guard (assertion or test) that would fail loudly next time. |
| Report evidence and honesty | Every number matches a saved run; baseline and network share split and metric; limitations and the decision are explicit. | Separates seed spread from model differences and states what the comparison cannot establish. |
| Architecture judgment | Each recommended family is linked to a property of the data and paired with a classical baseline. | Identifies a case where the classical model is the better first choice and explains why on cost, data size or maintenance grounds. |
| Recall and review | Shape arithmetic is correct after correction, misses are tagged, and the thread inventory is complete. | Connects a recall miss to a specific risk in the learner's own project code. |
Required output
Neural comparison, one ablation, limitations, and transfer-task evidence: the completed neural report (500-800 words with computed tables/figures and a decision), the unaided transfer-case log with the corrected comparison, corrected recall mistakes, the architecture-relevance defense, and the Week 9 priority.
Studios are tracked separately from the 60 core lessons; completing one never completes a lesson.