week04_mlp.ipynb
Download .ipynb ·
Deliverables hub
Open in Jupyter from repo: jupyter notebook mmc/notebooks/week04_mlp.ipynb
Cell 1 · markdown
# Week 4 — MLP from scratch
**MMC / DeepMind track** — show-work notebook.
### How to run
- **Local (Anaconda):** from repo root
`conda activate controlsift-mmc` then `powershell -File scripts/start_mmc_jupyter.ps1`
or open this file in JupyterLab and use kernel **Python (controlsift-mmc)**.
- **GitHub Pages cannot execute notebooks** (static hosting only). After the repo is on GitHub, use **Open in Colab** / Binder links on the deliverables hub, or clone and run locally.
## Official DeepMind labs (checkbox)
- `vendor/ai-foundations/course_3/gdm_lab_3_4_design_your_own_mlp.ipynb`
Full map: `mmc/GDM_LAB_MAP.md`. Upstream clone: `vendor/ai-foundations/`.
## ControlSift exceed path
Run the cells below to regenerate **this repo's** graded artifacts under `mmc/deliverables/outputs/`.
Do not invent Gemma metrics; leave GPU rows null until a real HF/Kaggle run.
Cell 2 · code
from pathlib import Path
import os
import sys
# Resolve repo root whether Jupyter cwd is repo root or mmc/notebooks/
here = Path.cwd().resolve()
root = None
for candidate in [here, *here.parents]:
if (candidate / "mmc" / "labs").is_dir() and (candidate / "mmc" / "notebooks").is_dir():
root = candidate
break
if root is None:
raise RuntimeError("Could not find ControlSift repo root (expected mmc/labs/). Open Jupyter from the repo.")
os.chdir(root)
if str(root) not in sys.path:
sys.path.insert(0, str(root))
print("cwd:", Path.cwd())
print("python:", sys.executable)
Cell 3 · code
from mmc.labs.week04_mlp import run
import json
result = run()
show = {k: result.get(k) for k in ['final_loss', 'test_accuracy', 'weights']} if ['final_loss', 'test_accuracy', 'weights'] else result
print(json.dumps(show, indent=2, default=str))
result