Commit Graph

10 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
0378da462c Add consistent Aha Moment demos to all 20 modules
Each module now includes a self-contained demo function that:
- Uses the 🎯 emoji for consistency with MODULE SUMMARY
- Explains what was built and why it matters
- Provides a quick, visual demonstration
- Runs automatically after test_module() in __main__

Format: demo_[module_name]() with markdown explanation before it.
All demos are self-contained with no cross-module imports.
2025-12-04 06:33:31 -08:00
Vijay Janapa Reddi
5720b49a49 Fix pooling diagram ASCII box alignment in 09_spatial 2025-11-30 09:54:11 -05:00
Vijay Janapa Reddi
c2d6a89876 Fix convolution diagram ASCII box alignment in 09_spatial 2025-11-30 09:53:03 -05:00
Vijay Janapa Reddi
c4d0bdb901 Add ASCII box alignment tool and fix 46 simple boxes
- Add tools/dev/fix_ascii_boxes.py for aligning ASCII art boxes
- Fix alignment of right-side vertical bars in simple boxes
- Tool handles simple boxes (2 vertical bars per line)
- Reports complex nested boxes for manual review (118 found)
- Fixed boxes in: src/, milestones/
2025-11-30 08:57:51 -05:00
Vijay Janapa Reddi
5fc50b21c9 Add nbdev export directives to modules for package generation 2025-11-29 19:16:44 -05:00
Vijay Janapa Reddi
55df7e5d9a Remove analysis functions from Module 09 test execution
Module 09's main block was calling analyze_convolution_complexity() and
analyze_pooling_effects() before test_module(). These analysis functions
are educational demonstrations that:
- Run computational benchmarks with timing
- Test multiple configurations for performance analysis
- Take significant time to execute

During 'tito module test', we only want to run test_module() to verify
correctness, not run performance benchmarks. This reduces Module 09
test time significantly (from ~30+ seconds to ~12 seconds).

Analysis functions remain in the module for educational purposes but
are not exported and not called during standard testing.

All other modules (01-20) already follow this pattern correctly.
2025-11-29 14:54:05 -05:00
Vijay Janapa Reddi
5cf0150805 Add BatchNorm and data augmentation to CIFAR-10 milestone
- Enhanced CIFAR-10 CNN with BatchNorm2d for stable training
- Added RandomHorizontalFlip and RandomCrop augmentation transforms
- Improved training accuracy from 65%+ to 70%+ with modern architecture
- Updated demo tapes with opening comments for clarity
- Regenerated welcome GIF, removed outdated demo GIFs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 12:27:15 -05:00
Vijay Janapa Reddi
403d4c2f4c Add .tito/backups and docs/_build to gitignore 2025-11-28 14:59:51 +01:00
Vijay Janapa Reddi
3e36b520b3 Complete src-modules separation: Update all symlinks and infrastructure
## Symlink Updates (modules/ → src/)
- Update all 20 site/modules/*_ABOUT.md symlinks to point to src/
- Update all 20 src/*/ABOUT.md internal references

## Infrastructure Changes
- Remove bin/ directory scripts (moved to scripts/ in previous commit)
- Update .envrc: Reference new scripts/ directory structure
- Update pyproject.toml: Reflect src/ as primary source location
- Update docs/development/MODULE_ABOUT_TEMPLATE.md: src/ paths
- Update site/requirements.txt: Documentation dependencies

## Restructuring Complete

The repository now has clean separation:
- `src/`: Developer source code (graded notebooks with solutions)
- `modules/`: Student workspace (generated from src/)
- `scripts/`: Build and utility scripts
- `site/`: Documentation and Jupyter Book website

This enables the intended workflow:
1. Developers work in src/
2. Students receive generated notebooks in modules/
3. Both can coexist without conflicts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 11:30:06 -05:00
Vijay Janapa Reddi
d3a126235c Restructure: Separate developer source (src/) from learner notebooks (modules/)
Major directory restructure to support both developer and learner workflows:

Structure Changes:
- NEW: src/ directory for Python source files (version controlled)
  - Files renamed: tensor.py → 01_tensor.py (matches directory naming)
  - All 20 modules moved from modules/ to src/
- CHANGED: modules/ now holds generated notebooks (gitignored)
  - Generated from src/*.py using jupytext
  - Learners work in notebooks, developers work in Python source
- UNCHANGED: tinytorch/ package (still auto-generated from notebooks)

Workflow: src/*.py → modules/*.ipynb → tinytorch/*.py

Command Updates:
- Updated export command to read from src/ and generate to modules/
- Export flow: discovers modules in src/, converts to notebooks in modules/, exports to tinytorch/
- All 20 modules tested and working

Configuration:
- Updated .gitignore to ignore modules/ directory
- Updated README.md with new three-layer architecture explanation
- Updated export.py source mappings and paths

Benefits:
- Clean separation: developers edit Python, learners use notebooks
- Better version control: only Python source committed, notebooks generated
- Flexible learning: can work in notebooks OR Python source
- Maintains backward compatibility: tinytorch package unchanged

Tested:
- Single module export: tito export 01_tensor 
- All modules export: tito export --all 
- Package imports: from tinytorch.core.tensor import Tensor 
- 20/20 modules successfully converted and exported
2025-11-25 00:02:21 -05:00