Skip to content

Standardize W1D1-W1D4 tutorial dependency setup and imports#1021

Open
cindyhfls wants to merge 12 commits intoNeuromatchAcademy:stagingfrom
cindyhfls:week1-tutorials-update
Open

Standardize W1D1-W1D4 tutorial dependency setup and imports#1021
cindyhfls wants to merge 12 commits intoNeuromatchAcademy:stagingfrom
cindyhfls:week1-tutorials-update

Conversation

@cindyhfls
Copy link
Copy Markdown
Contributor

@cindyhfls cindyhfls commented Mar 30, 2026

Summary

  • Adds tutorials/requirements_tutorials.txt listing all Colab/Kaggle pre-installed packages with minimum version bounds (Python ≥ 3.10). Intended for students running tutorials locally.
  • Adds a version check cell to each W1D1–W1D4 tutorial (Setup section): auto-installs any tutorial-specific extras not pre-installed on Colab, then prints key package versions for reproducibility and bug reports.
  • Consolidates all imports to the top-level Setup section; removes scattered import statements and duplicate !pip install calls throughout each notebook.
  • Updates the "Meet Our Lecturers" cell in W1D1_Tutorial1: flat alphabetical list of all content creators across all days with websites where available. Adds a "Past contributors" section for lecturers from days no longer in the main curriculum.

Notebooks changed

  • tutorials/requirements_tutorials.txt (new)
  • tutorials/W1D1_BasicsAndPytorch/W1D1_Tutorial1.ipynb
  • tutorials/W1D2_LinearDeepLearning/W1D2_Tutorial1.ipynb
  • tutorials/W1D2_LinearDeepLearning/W1D2_Tutorial2.ipynb
  • tutorials/W1D2_LinearDeepLearning/W1D2_Tutorial3.ipynb
  • tutorials/W1D3_MultiLayerPerceptrons/W1D3_Tutorial1.ipynb
  • tutorials/W1D3_MultiLayerPerceptrons/W1D3_Tutorial2.ipynb
  • tutorials/W1D4_Optimization/W1D4_Tutorial1.ipynb

Test plan

  • Run W1D1_Tutorial1.ipynb on Colab — verify version check cell prints correct package versions ✅
  • Run W1D2_Tutorial1.ipynb on Colab — verify version check cell and imports work
  • Spot-check that no !pip install or stray import statements remain mid-notebook in W1D2–W1D4
  • Verify pip install -r tutorials/requirements_tutorials.txt works in a clean local environment

🤖 Generated with Claude Code

cindyhfls and others added 2 commits March 29, 2026 20:27
- 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>
Copy link
Copy Markdown
Contributor

@iamzoltan iamzoltan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a separate requirements file?

Comment thread tutorials/requirements_tutorials.txt Outdated
Comment on lines +1 to +23
# 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these already included in the requirements file? why not just add missing packages there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

cindyhfls and others added 4 commits March 29, 2026 21:41
…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>
@cindyhfls cindyhfls changed the base branch from main to staging April 5, 2026 19:29
cindyhfls and others added 2 commits April 5, 2026 15:55
- 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>
Copy link
Copy Markdown
Contributor

@iamzoltan iamzoltan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. and likely throughout the whole PR

Comment thread requirements.txt
Comment on lines -16 to -17
moviepy==1.0.3
imageio_ffmpeg
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure that we dont need the old packages you didnt include?

@cindyhfls
Copy link
Copy Markdown
Contributor Author

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?

@cindyhfls cindyhfls marked this pull request as draft April 10, 2026 19:32
cindyhfls and others added 4 commits April 10, 2026 15:36
- 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>
@cindyhfls cindyhfls marked this pull request as ready for review April 27, 2026 19:50
@cindyhfls
Copy link
Copy Markdown
Contributor Author

@iamzoltan do you mean this pull request? I think it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants