Improve all workshop notebooks for clear real-data learning (#44) - #50
Conversation
…composition for issue #44
project-delphi
left a comment
There was a problem hiding this comment.
Review
This is the PR for issue #44 (there is no pull request numbered 44). The teaching rewrite is real and mostly in the right direction — bilingual objectives now live in _variables.yml, the named synthetic-data spots in §07 / §08 / §11 are either replaced or explicitly justified, the exercise triple is now consistent, and notebooks/ is byte-identical to docs/notebooks/. CI render is green.
I am requesting changes for the evidence #44 asked for, plus a few things that would ship a different workshop than the one the decks still describe.
Requested changes
1. No Colab “Run all” screenshots anywhere
Issue #44 is explicit about this:
Before-and-after screenshots of each notebook posted as a comment on this issue. The notebooks are committed with no outputs, so screenshots are the only record anyone has of what a run actually looks like.
I checked PR #50 (description, conversation, review threads) and issue #44 (comments). There are zero screenshots, before or after, for any of the twelve notebooks. The PR body correctly says this is still outstanding and that the PR should not close #44 — but that evidence is also what a reviewer needs in order to believe Run All actually works in Colab. Static source is not a substitute: widgets, Plotly, video decode, and %pip cells only show their real shape after a live run.
Please post, on issue #44 (and link from this PR):
- one Run all screenshot per notebook (00–11), taken in Colab, showing the executed outputs / widgets / plots, not just the unrun source
- ideally a matching before shot, or a short note per notebook of what changed visually if a true before is gone
Without those, #44 cannot be signed off.
2. Committed widget state is leftover run output
Cell outputs and execution_count are cleared, but notebooks 05–11 still ship metadata.widgets from the Colab round-trip — including rendered Plotly HTML, stdout, and PNG snapshots. That is committed output, just stored one level up:
| notebook | file size | metadata.widgets |
|---|---|---|
| 05 | 322 KB | ~300 KB |
| 06 | 503 KB | ~461 KB |
| 07 | 92 KB | ~50 KB |
| 08 | 93 KB | ~60 KB (includes Fibonacci stdout + a Plotly figure) |
| 09 | 423 KB | ~395 KB |
| 10 | 205 KB | ~172 KB |
| 11 | 1.36 MB | ~1.32 MB |
scripts/gen_notebooks.py strips per-cell outputs and Colab cell metadata, then preserves notebook-level metadata as-is, so this state survives a normalize pass. Please drop metadata.widgets in the normalizer (and regenerate). Screenshots on the issue are the record of a run; the .ipynb files should stay empty.
3. §02 notebook and the decks no longer describe the same session
The notebook is now three real-data coding exercises: it %pip installs ffmpeg, downloads and checksums the 5.9 MB Almadrava clip, and builds a padded order-5 batch. Meanwhile:
_variables.ymlstill hasformat_en: group- the EN deck title slide still says
*Part II · group discussion · no code* - both decks and the handbook still teach the shape ladder with
np.zeros((28, 28))etc. - the handbook still says “Go to your breakout channel. No code.”
The notebook even says “We will not invent arrays with np.zeros to build a shape ladder.” Facilitators following the deck will run a different lesson than students who open Colab. Either update the slides/handbook/format to match the new notebook, or keep §02 as the discussion block the clock still allocates 20 minutes of group time for.
4. Spanish objectives never appear in the notebooks
objectives_es was added for every section in _variables.yml (good — that was a named #44 gap). header_cell() in scripts/gen_notebooks.py still only renders objectives_en. Students reading the notebook never see the Spanish outcomes; only the title/summary blockquote is bilingual. Please print both lists in the header (or an > 🇪🇸 block under “What you will be able to do”).
Also please fix (smaller)
- §01 has no
## Why this matters. It jumps Setup →## 1.1 Vocabulary. Every other rewritten notebook uses the standard shape. notebooks/00-setup-and-data.ipynbcell “A note on how these notebooks work” has no🇪🇸blockquote. Issue #44 asked for one on every new markdown cell.- Generated
## Done with this sectionfooters are English-only. Pre-existing, but this PR is the natural place to add a Spanish line infooter_cell().
What looks good
- Named #44 synthetic spots were actually addressed: §07 exercises now run on California housing; §08 keeps Fibonacci / a controlled eigen-gap matrix and says so, then forecasts real airline passengers; §11 take-homes B and D justify synthetic QKV / covariance, and E uses a real voice clip.
- Exercise shape is now consistent (markdown →
# TODO→ folded#@title Solution) with 3/3 on 01–10 and 5 take-homes on 11. - Kahoot footers land after 04, 07, 10; everyone else gets “Done with this section.”
- Widget notebooks call
enable_custom_widget_manager(). notebooks/*.ipynbanddocs/notebooks/*.ipynbare byte-identical. No cell-level outputs or execution counts.
Once the twelve Run All screenshots are on issue #44 and the widget-state / §02 / objectives_es items are cleaned up, this is in good shape to merge as the content PR, with #44 staying open only if learning-outcome sign-off is still pending.
|
@Laverde97 — per-notebook review for #44 / PR #50. Twelve comments follow, one per notebook (00–11). Cross-cutting (all notebooks):
Details per notebook below. |
§00 · Setup and welcomeVerdict: ✅ Mostly ready — small polish only. Structure: Header → Setup → Why this matters → 2 exercises (TODO + folded solution) → What just happened → Done. Matches #44 shape. No Kahoot (correct). Data: All real — breast cancer, digits, skimage photos, housing/taxis/flights CSVs, video reachability check. “Why this matters” scopes the workshop’s real-data claim and names later synthetic exceptions. Good fix for the old “nothing is invented” overstatement. Run All: Should work in Colab. Actions:
|
§01 · What a tensor isVerdict: ✅ Strong content — one structural gap. Structure: 3 exercises with TODO/solution triples, What just happened, Done footer. Missing Data: Tiny Run All: Should work. Widgets in Exercise 3 call Actions:
|
§02 · Thinking in N dimensionsVerdict: Structure: Why this matters → 3 exercises → What just happened → Done. Exercise triple consistent. Bilingual prose throughout. Data: Real digits, astronaut photo, pinned Almadrava video (SHA-256 verified), order-5 padded batch with validity mask. Run All: Will work but is heavy — Setup Blocker — deck/handbook drift: Notebook is now a coding exercise; Actions:
|
§03 · Indexing and broadcasting real dataVerdict: ✅ Ready. Structure: Full standard shape. 3 exercises, What just happened, Done. All markdown cells have 🇪🇸 except generated footer. Data: Breast cancer (column by name, boolean masks) + digits (broadcasting standardization, zero-variance trap). Prose calls out why synthetic random data would miss the trap. Fully real in exercises. Run All: Clean file (13 KB). Widgets + Actions: Run All screenshot on #44 — boolean mask exercise + zero-variance pixel discovery. |
§04 · Reshape and transpose real imagesVerdict: ✅ Ready — model notebook for structure. Structure: Why this matters → 3 exercises → What just happened → Kahoot footer (correct for §04). Every markdown cell bilingual including Kahoot block. Data: Three distinct skimage RGB images (astronaut, immunohistochemistry, coffee). HWC↔CHW, NHWC↔NCHW, reshape-vs-transpose trap on real pixels. No synthetic arrays. Run All: Lightweight (14 KB). No widgets. Should run fast in Colab. Actions: Run All screenshot on #44 — side-by-side transpose vs reshape on a real image. |
§05 · Video pipeline designVerdict: ✅ Strong — clean committed output. Structure: Why this matters → 3 exercises → What just happened → Done. Predict → Run → Explain pattern. Exercise triple consistent. Data: Pinned Almadrava clip end-to-end — decode to Run All: Setup decodes full video in Colab (~same cost as §02). Widgets for pipeline exploration. Actions:
|
§06 · Contraction with einsumVerdict: ✅ Excellent rewrite — watch file size. Structure: Why this matters (one rule + Predict→Run→Explain) → 3 rich exercises → What just happened → Done. Teaching subheadings (“What are you looking at?”, “What should you try?”) are a nice pattern for 06–10. Data: Microscopy RGB contraction, digit pixel patches for trace/transpose/matmul, full 1,797-image similarity matrix with cosine vs dot product. All real. Objectives match exercises closely. Run All: Exercise 3 builds ~3.2M similarities — may take 10–20 s in Colab but should complete. Actions:
|
§07 · Inverses and the pseudoinverseVerdict: ✅ Issue #44 gap fully closed. Structure: Why this matters → 3 exercises → What just happened → Kahoot footer. Bilingual including Kahoot block and folded-solution instructions. Data: Old Run All: Housing CSV download in Setup. Plotly widgets for wide/square/tall exploration. Actions:
|
§08 · Recursion with matrices and vectorsVerdict: ✅ Synthetic spots now justified; real forecast added. Structure: Why this matters → 3 exercises → What just happened → Done. Consistent with 06–07 template. Data: Exercise 1: Fibonacci as matrix state update (controlled, not pretending to be domain data). Exercise 2: explicitly labeled synthetic 2×2 eigen-gap matrix — fixes #44 complaint. Exercise 3: real airline passengers + pseudoinverse AR forecast with compounding error. Old random RNN skeleton replaced. Run All: Flights CSV in Setup. Widgets for Fibonacci steps and eigen-ratio slider. Actions:
|
§09 · Convolution and deconvolutionVerdict: ✅ Ready — minor synthetic noise is fine. Structure: Standard 06–10 template. 3 exercises, What just happened, Done. Data: Real camera/astronaut pixels for conv/correlate/Toeplitz; transposed conv shape demo; Richardson-Lucy on real blurred photograph. Solution adds Run All: Actions:
|
§10 · Tucker decomposition on real dataVerdict: ✅ Ready — strong capstone for Part IV. Structure: Standard template → What just happened → Kahoot footer (correct). Data: NYC taxi CSV → genuine order-3 tensor, three-mode unfoldings, HOSVD via SVD+einsum only, rank trade-off sliders, temporal factor linked to hour-18 rush. All real, no random fill-ins. Run All: Actions:
|
§11 · Wrap-up and take-homesVerdict: ✅ Take-homes well scoped — file size is the main issue. Structure: Why this matters (connecting idea) → 5 take-homes (A–E), each with TODO + folded solution → What just happened → Done. 5/5 exercise triple (appropriate for wrap-up). Data: A: real breast cancer PCA scaling trap. B: synthetic Q/K/V explicitly justified (mechanics without tokenizer) — uses Run All: Heaviest notebook — audio download, STFT/SVD/ISTFT, multiple Actions:
|
|
Addressed the requested review fixes in commit
Validation completed successfully:
Remaining manual items from Issue #44:
Those manual items are intentionally not represented as local-code validation. |
a la antigua exageración de que «nada es inventado».
Notebook 00 · Setup and welcome — Colab Run All evidenceExecuted
Screenshots below show the executed Colab session and the relevant setup/shape outputs.
|
|
Super, let's get the rest of the notebooks done and completing the requests we want handled. |


Summary
Addresses #44.
Reworks notebooks 00–11 so each section teaches a clear concept end-to-end with
real data, or explicitly justified synthetic examples where they are
pedagogically appropriate.
Highlights:
Notebook coverage
Validation
scripts/gen_tables.py— idempotentscripts/gen_notebooks.py— idempotent; 12/12 validscripts/check_links.py— all checks passgit diff --check— cleannotebooks/*.ipynbbyte-identical todocs/notebooks/*.ipynbFollow-up evidence
Issue #44 also asks for before/after screenshots of all twelve notebooks and
final learning-outcome sign-off. Those are issue-level review/evidence
follow-ups, are still outstanding, and are not embedded as notebook outputs.
This PR references #44 but does not close it — the issue stays open for the
remaining screenshot and sign-off work.
🤖 Generated with Claude Code