Skip to content

Cohort seven updates#82

Merged
danielrazavi merged 21 commits intomainfrom
cohort_seven_updates
Oct 21, 2025
Merged

Cohort seven updates#82
danielrazavi merged 21 commits intomainfrom
cohort_seven_updates

Conversation

@alexwolson
Copy link
Contributor

Cohort Seven Updates

Summary

This PR includes comprehensive updates to prepare the deep learning course materials for Cohort Seven. The changes encompass lab improvements, dependency management, repository structure reorganization, and the removal of deprecated materials.

Key Changes:

  • Lab Fixes & Enhancements: Addressed bugs and improved functionality in labs 1, 2, 5, and 6
  • Dependency Management: Added missing dependencies to pyproject.toml and refreshed uv.lock
  • Repository Structure: Created cohort_seven directory and migrated deprecated labs to archived locations
  • Documentation: Updated READMEs to reflect current lab structure and environment setup
  • Cleanup: Removed legacy materials and added appropriate .gitignore entries for large artifacts

Detailed Changes

Bug Fixes & Lab Improvements

Lab 1: Keras Input Layer Warning Fix

  • Issue: Keras was generating deprecation warnings when using input_shape parameter in Dense layers
  • Solution: Added explicit Input(shape=...) layer before the first Dense layer
  • Files: 01_materials/labs/lab_1.ipynb
  • Impact: Eliminates warnings and follows current Keras best practices

Lab 2: Division by Zero Guard

  • Issue: Training loop attempted to log metrics at step 0, causing division by zero or empty slice warnings
  • Solution: Added guard condition if i > 0 and i % 100 == 0 to skip logging at step 0
  • Files: 01_materials/labs/lab_2.ipynb
  • Impact: Prevents runtime warnings during training initialization

Lab 5: Major Refactoring

Multiple improvements to make the lab more robust and maintainable:

  1. Dataset URL Migration

    • Switched from defunct Oxford servers to GitHub mirror for VOC dataset
    • Changed URL from http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
    • To: https://github.com/alexwolson/pascal-voc-2007-mirror/raw/main/VOCtrainval_06-Nov-2007.tar.gz
    • Updated file extension from .tar to .tar.gz
  2. Representation Computing

    • Removed dependency on pre-downloaded representations file
    • Implemented local computation with caching mechanism
    • Added compute_acc API refactoring for better maintainability
    • Added progress bars with tqdm for batch processing
    • Auto-saves computed representations to voc_representations.h5 for reuse
  3. Model Training Parameters

    • Set loss_weights to [1., 10.] for better class/bbox balance
    • Removed deprecated symbolic tensor boolean checks
  4. Code Quality

    • Improved code formatting and comments
    • Better batch processing logic
    • More informative print statements for user guidance
  • Files: 01_materials/labs/lab_5.ipynb
  • Impact: Lab is now self-contained, more reliable, and easier to understand

Lab 6: Convergence Improvement

  • Change: Increased LogisticRegression max_iter from default to 1000
  • Reason: Prevents convergence warnings during model training
  • Documentation: Updated markdown to remove convergence warning notes
  • Files: 01_materials/labs/lab_6.ipynb
  • Impact: Smoother training experience without spurious warnings

Dependency Management

pyproject.toml Updates

Added missing dependencies required by lab exercises:

h5py = "^3.12.1"
tqdm = "^4.67.1"
imageio = {extras = ["pyav"], version = "^2.36.1"}
scikit-image = "^0.24.0"
  • h5py: Required for caching representations in Lab 5
  • tqdm: Progress bars for long-running operations
  • imageio[pyav]: Image and video I/O with AV codec support
  • scikit-image: Image processing utilities

uv.lock Refresh

  • Regenerated lock file with updated dependencies
  • Ensures reproducible builds across all environments
  • Resolves version conflicts and dependency trees

Repository Structure & Cleanup

Cohort Directory Creation

  • Updated 04_cohort_seven/ directory name
  • Established 04_cohort_seven/additional_resources/labs/ for archived materials

Deprecated Lab Migration

Moved labs 8, 9, and 10 to archived locations:

  • From: 01_materials/labs/lab_8.ipynb, lab_9.ipynb, lab_10.ipynb
  • To: 04_cohort_seven/additional_resources/labs/
  • Rationale: These labs are no longer part of the core curriculum but preserved for reference

.gitignore Updates

Added entries for large artifacts that shouldn't be version controlled:

test_notebooks/
voc_representations.h5
VOCdevkit/
VOCtrainval_06-Nov-2007.tar.gz

Documentation Updates

README.md

  • Updated to reflect current lab structure (labs 1-6 only)
  • Updated instructional team documentation

Instructional Team Documentation

  • Updated 03_instructional_team/README.md
  • Clarified lab sequencing and content coverage
  • Documented deprecated materials locations

Assignment Updates

Minor updates to assignments 1 and 2 to align with lab fixes

  • Files: 02_activities/assignments/assignment_1.ipynb, assignment_2.ipynb

@github-actions
Copy link

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR prepares the deep learning course materials for Cohort Seven by updating dates, contact information, lab structure, and fixing bugs across multiple labs. The changes consolidate the curriculum to 6 core labs, improve code reliability, and enhance the learning experience through dependency management and environment setup improvements.

Key Changes:

  • Updated cohort-specific metadata (dates, contact info, Slack channels) from Cohort Six to Cohort Seven
  • Fixed bugs in labs 1, 2, 5, and 6 to improve functionality and prevent warnings
  • Added missing dependencies (h5py, tqdm, imageio, scikit-image) to pyproject.toml
  • Migrated deprecated labs (8, 9, 10) to archived directory

Reviewed Changes

Copilot reviewed 13 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Added missing dependencies required for labs
README.md Updated dates, assessment structure, contact info, and cohort references
README.html Applied same metadata updates as README.md
04_cohort_six/additional_resources/labs/lab_*.ipynb Deleted deprecated lab files (8, 9, 10)
03_instructional_team/README.md Updated session dates and cohort references
02_activities/assignments/assignment_*.ipynb Updated due dates, Slack channels, and submission requirements
01_materials/labs/lab_6.ipynb Increased LogisticRegression max_iter and removed convergence warning note
01_materials/labs/lab_5.ipynb Changed dataset URL, implemented local representation computing, adjusted loss_weights
01_materials/labs/lab_2.ipynb Added guard condition to prevent division by zero at step 0
01_materials/labs/lab_1.ipynb Added explicit Input layer to follow Keras best practices

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor Author

@alexwolson alexwolson left a comment

Choose a reason for hiding this comment

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

Manually re-reviewed my changes on GitHub.

@github-actions
Copy link

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

The code checks if values are None, not if names are undefined, so ValueError is semantically correct.
@github-actions
Copy link

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

@alexwolson alexwolson marked this pull request as draft October 18, 2025 18:18
alexwolson and others added 2 commits October 18, 2025 14:18
Resolved conflicts:
- .gitignore: Combined both sets of ignore rules
- README.md: Updated to reference cohort_seven and included SETUP.md/pyproject.toml descriptions
- pyproject.toml: Kept cohort_seven dependencies with additional packages from main
- Directory structure: Kept 04_cohort_seven over 04_this_cohort naming convention
@github-actions
Copy link

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

@alexwolson alexwolson marked this pull request as ready for review October 18, 2025 18:26
Copy link
Member

@danielrazavi danielrazavi left a comment

Choose a reason for hiding this comment

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

The merging of the move_to_uv branch has caused this PR to go stale. @alexwolson no action needed from you, will make a new commit that will fix this PR. Stand by.

@github-actions
Copy link

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

@github-actions
Copy link

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

Copy link
Member

@danielrazavi danielrazavi left a comment

Choose a reason for hiding this comment

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

Looks good to me now. @alexwolson can you please do one final review, and if its good, we'll merge it in.

@alexwolson
Copy link
Contributor Author

Re-reviewed. All looks good to me. Thank you for your help @danielrazavi

@danielrazavi danielrazavi merged commit f74aeb8 into main Oct 21, 2025
1 check passed
@danielrazavi danielrazavi deleted the cohort_seven_updates branch October 21, 2025 14:51
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