Standardize W1D1-W1D4 tutorial dependency setup and imports#1021
Standardize W1D1-W1D4 tutorial dependency setup and imports#1021cindyhfls wants to merge 12 commits intoNeuromatchAcademy:stagingfrom
Conversation
- Add version check cell to W1D1-W1D4 tutorials (prints installed package versions, points local users to requirements_tutorials.txt) - Consolidate all imports to top-level Setup section; remove scattered imports and duplicate pip installs throughout each notebook - Update W1D1 Meet Our Lecturers: flat alphabetical list of all content creators with websites, annotated by source; add Past contributors section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
iamzoltan
left a comment
There was a problem hiding this comment.
Why do we need a separate requirements file?
| # Requirements for Neuromatch Academy Deep Learning tutorials | ||
| # These packages are pre-installed on Google Colab/Kaggle. | ||
| # For local setup: pip install -r requirements_tutorials.txt | ||
| # | ||
| # Python >= 3.10 required | ||
| # Tutorial-specific packages (e.g. transformers, diffusers, altair) are | ||
| # installed at the top of the relevant tutorial notebooks. | ||
|
|
||
| numpy>=2.0 | ||
| pandas>=2.2 | ||
| matplotlib>=3.10 | ||
| torch>=2.0 | ||
| torchvision>=0.15 | ||
| scikit-learn>=1.3 | ||
| scipy>=1.13 | ||
| Pillow>=10.0 | ||
| imageio>=2.30 | ||
| seaborn>=0.13 | ||
| nltk>=3.9 | ||
| tensorboard>=2.19 | ||
| ipywidgets>=8.0 | ||
| tqdm>=4.0 | ||
| requests>=2.31 |
There was a problem hiding this comment.
are these already included in the requirements file? why not just add missing packages there?
There was a problem hiding this comment.
It looks like the other requirements file in the main repo was for building the books and use very old versions. @bgalbraith said we might want a requirements file for people who run things locally instead of using colab (with colab a lot of packages were pre-installed).
There was a problem hiding this comment.
The only requirements file was for the whole repo. building the books actually uses a different requirements file from a different repo. We should treat this requirements file as all the dependencies you would need to run this repo.
…inks - Extract altair/paper visualization bonus section into W1D1_BonusLecture.ipynb with its own install, feedback, and imports cells; remove altair/vega_datasets from main tutorial install and imports - Add Colab GPU conservation tips callout before Section 2.4; highlight that setup cells must be rerun after runtime restart - Add bold Appendix references with Colab jump links in cells referencing tensor methods, .view() docs, and GPU usage policy - Fix commented-out imports in Section 2.5 with explanatory note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moved `import torch` before numpy/matplotlib in T2 imports cell to match course-wide convention; removed duplicate `import torch` from set_seed helper. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Split W1D4_Tutorial1: sections 5–8 (non-convexity, mini-batches, adaptive methods, ethics) and bonus exercise moved to new W1D4_BonusLecture.ipynb with a self-contained setup block. Tutorial1 now covers sections 1–4 only. - Moved W2D2_Tutorial2 (DL Thinking 1 — cost functions) to W1D4_Tutorial2; renamed all "DL Thinking" text to "DL Case Study". - Updated curriculum review plan: W1D4 done items, W2D2 T2 status. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- materials.yml: move Tutorial 2 slide entry from W2D2 to W1D4; update tutorial counts (W1D4: 1→2, W2D2: 2→1) - curriculum_review_plan.md: add W1D5 flex day note to check project notebook day title consistency after restructuring Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename W2D2_ConvnetsAndDlThinking → W2D2_Convnets to reflect that
the DL Case Study tutorial has moved to W1D4
- materials.yml: update W2D2 day name to "Convnets"
- W1D4_Tutorial2: fix Colab/Kaggle badge paths, day label
("Convnets and DL Case Study" → "Optimization"), and
feedback_prefix ("W2D2_T2" → "W1D4_T2")
- curriculum_review_plan.md: mark W2D2 rename as done
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ts file per Konstantine's suggestion
iamzoltan
left a comment
There was a problem hiding this comment.
Coming closer.
We dont need to commit changes to instructor, solutions, static or students directories. We can generate those in the CI.
| "outputs": [], | ||
| "source": [ | ||
| "# @title Install dependencies\n", | ||
| "# Running locally? See tutorials/requirements_tutorials.txt\n", |
There was a problem hiding this comment.
these helper comments look wrong now
| "source": [ | ||
| "# @title Install and check dependencies\n", | ||
| "# Most packages are pre-installed on Colab/Kaggle.\n", | ||
| "# Running locally? See tutorials/requirements_tutorials.txt\n", |
There was a problem hiding this comment.
same here. and likely throughout the whole PR
| moviepy==1.0.3 | ||
| imageio_ffmpeg |
There was a problem hiding this comment.
are you sure that we dont need the old packages you didnt include?
|
I will fix that. Do I need to revert the changes to the student/solution etc.? Or will they be overwritten later anyway so it's fine to keep it there? |
- Tutorial1: update stale requirements path from tutorials/requirements_tutorials.txt to GitHub URL (requirements.txt was consolidated per Konstantine's suggestion) - Tutorial2: add missing version check / install cell to Setup section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Revert JSON formatting artifacts introduced by opening notebooks in VS Code/Jupyter: source fields changed from strings to arrays, and id field reordering. No content changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@iamzoltan do you mean this pull request? I think it's ready. |
Summary
tutorials/requirements_tutorials.txtlisting all Colab/Kaggle pre-installed packages with minimum version bounds (Python ≥ 3.10). Intended for students running tutorials locally.importstatements and duplicate!pip installcalls throughout each notebook.Notebooks changed
tutorials/requirements_tutorials.txt(new)tutorials/W1D1_BasicsAndPytorch/W1D1_Tutorial1.ipynbtutorials/W1D2_LinearDeepLearning/W1D2_Tutorial1.ipynbtutorials/W1D2_LinearDeepLearning/W1D2_Tutorial2.ipynbtutorials/W1D2_LinearDeepLearning/W1D2_Tutorial3.ipynbtutorials/W1D3_MultiLayerPerceptrons/W1D3_Tutorial1.ipynbtutorials/W1D3_MultiLayerPerceptrons/W1D3_Tutorial2.ipynbtutorials/W1D4_Optimization/W1D4_Tutorial1.ipynbTest plan
!pip installor strayimportstatements remain mid-notebook in W1D2–W1D4pip install -r tutorials/requirements_tutorials.txtworks in a clean local environment🤖 Generated with Claude Code