📚 Clean up and modernize documentation

- Create comprehensive INSTRUCTOR_GUIDE.md with verified modules, teaching sequence, and practical commands
- Create new STUDENT_GUIDE.md based on actual working state with correct module numbering
- Update main docs/README.md to reflect current capabilities and clean structure
- Remove outdated docs/students/project-guide.md that had incorrect information
- Focus on 6+ weeks of proven curriculum content currently ready for classroom use
- Base all documentation on verified test results and working module status
This commit is contained in:
Vijay Janapa Reddi
2025-07-12 11:12:43 -04:00
parent 77150be3a6
commit bf97b9af96
3 changed files with 658 additions and 72 deletions

261
docs/INSTRUCTOR_GUIDE.md Normal file
View File

@@ -0,0 +1,261 @@
# 🎓 TinyTorch Instructor Guide
**Complete instructor guide for teaching the TinyTorch ML Systems course.**
## 🎯 **Course Overview**
TinyTorch is a **Machine Learning Systems** course where students build every component from scratch. Students implement their own ML framework, then use their implementation to solve real problems.
### **Core Philosophy: Build → Use → Understand → Repeat**
- **Build**: Students implement functions like `ReLU()` from scratch
- **Use**: Students immediately use `from tinytorch.core.activations import ReLU` with their own code
- **Understand**: Students see how their implementations work in real systems
- **Repeat**: Each module builds on previous work
## 🚀 **Quick Start for Instructors**
### **Verify Your System** (5 minutes)
```bash
cd TinyTorch
tito system info # Check overall status
tito system doctor # Verify installation
tito module status # See all module progress
```
### **Test Drive the Course** (10 minutes)
```bash
cd modules/00_setup
jupyter lab setup_dev.py # Open first module
python -m pytest tests/ -v # Run tests
python bin/tito module export 00_setup # Export to package
```
### **Verify Student Experience** (5 minutes)
```bash
python -c "from tinytorch.core.utils import hello_tinytorch; hello_tinytorch()"
python -c "from tinytorch.core.activations import ReLU; print(ReLU()([-1, 0, 1]))"
```
## 📚 **Current Module Status** (Ready for Students)
### **✅ Fully Working Modules**
1. **00_setup** (20/20 tests) - Development workflow, CLI tools
2. **02_activations** (24/24 tests) - ReLU, Sigmoid, Tanh implementations
3. **06_dataloader** (15/15 tests) - CIFAR-10 loading, batch processing
### **✅ Core Working Modules**
4. **03_layers** (17/22 tests) - Dense layers, network building blocks
5. **04_networks** (20/25 tests) - Sequential networks, MLP creation
6. **05_cnn** (2/2 tests) - Basic convolution operations
### **⚠️ Partially Working**
7. **01_tensor** (22/33 tests) - Missing arithmetic operators
### **🚧 Not Yet Implemented**
- Modules 07-13 (autograd, optimizers, training, MLOps)
## 🎯 **Recommended Teaching Sequence**
### **Week 1-2: Foundation**
- **00_setup**: Students learn development workflow
- **02_activations**: Core ML math (ReLU, Sigmoid, Tanh)
### **Week 3-4: Building Blocks**
- **03_layers**: Neural network layers (Dense, parameter management)
- **04_networks**: Complete network composition (Sequential, MLP)
### **Week 5-6: Real Data**
- **06_dataloader**: Production data handling (CIFAR-10)
- **05_cnn**: Convolution operations
### **Week 7+: Advanced Features**
- **01_tensor**: Tensor arithmetic (when remaining tests pass)
- **Future modules**: Autograd, training, optimization
## 🛠️ **Student Workflow** (5 Simple Steps)
### **Step 1: Open Module**
```bash
cd modules/00_setup
jupyter lab setup_dev.py
```
### **Step 2: Learn & Implement**
- Read markdown explanations
- Complete TODO sections
- Test understanding incrementally
### **Step 3: Export Code**
```bash
python bin/tito module export 00_setup
```
### **Step 4: Test Work**
```bash
python -m pytest modules/00_setup/tests/ -v
```
### **Step 5: Use Their Code**
```bash
python -c "from tinytorch.core.utils import hello_tinytorch; hello_tinytorch()"
```
## 📋 **Class Session Structure** (50 minutes)
### **Preparation** (5 minutes)
```bash
tito system info # Check system
tito module status # Review progress
cd modules/[current_module] # Navigate to module
```
### **Opening** (10 minutes)
- Demo end goal: Show working code
- Connect to previous module
- Explain real-world relevance
### **Guided Implementation** (30 minutes)
- Students work on TODO sections
- Instructor provides hints/guidance
- Students test their implementations
### **Wrap-up** (5 minutes)
- Celebrate successful exports
- Preview next module
- Assign homework/practice
## 🔧 **Essential Instructor Commands**
### **System Status**
```bash
tito system info # Overall system status
tito system doctor # Environment verification
tito module status # All module progress
```
### **Module Management**
```bash
tito module test XX # Test specific module
tito module export XX # Export module to package
jupyter lab XX_dev.py # Open module for development
```
### **Student Help**
```bash
cat modules/XX/README.md # Module overview
tito nbgrader generate XX # Generate student version
tito package reset # Reset package state
```
### **Troubleshooting**
```bash
tito system doctor # Diagnose issues
tito package sync # Sync all modules
pytest modules/XX/tests/ -v # Detailed test output
```
## 👥 **Student Support**
### **Common Issues & Solutions**
**"Tests are failing"**
```bash
cd modules/XX
python -m pytest tests/ -v # See detailed failures
```
**"Can't import my code"**
```bash
python bin/tito module export XX # Re-export module
tito package sync # Sync all modules
```
**"Environment issues"**
```bash
tito system doctor # Check environment
source .venv/bin/activate # Activate virtual env
```
## 🎓 **Assessment Strategy**
### **Formative Assessment**
- **Daily**: Test output shows working implementations
- **Weekly**: Module completion with passing tests
- **Progressive**: Each module builds on previous work
### **Summative Assessment**
- **Portfolio**: Complete working TinyTorch implementation
- **Reflection**: Understanding of design decisions
- **Application**: Use their framework for real problems
## 🌟 **Key Educational Principles**
### **Real Data, Real Systems**
- Use CIFAR-10 (not toy datasets)
- Production-style code organization
- Performance considerations matter
### **Immediate Feedback**
- Tests provide instant verification
- Students see their code working quickly
- Progress is visible and measurable
### **Progressive Complexity**
- Start simple (activation functions)
- Build complexity gradually (layers → networks)
- Connect to real ML engineering
## 💡 **Teaching Tips**
### **Start Each Module**
1. **Demo the end goal**: Show working code
2. **Connect to previous work**: "Remember how we built..."
3. **Explain the why**: Real-world motivation
4. **Guide the how**: Implementation strategy
### **During Implementation**
- Encourage testing small pieces
- Use `print()` statements for debugging
- Celebrate small victories
- Connect to broader ML concepts
### **After Completion**
- Show how their code exports to package
- Demonstrate using their implementation
- Preview next module connections
- Assign practice problems
## 🔄 **Course Maintenance**
### **Before Each Semester**
```bash
git pull origin main # Update to latest
tito system doctor # Verify environment
tito module status # Check all modules
```
### **Regular Updates**
- Monitor test results across modules
- Update datasets/examples as needed
- Collect student feedback for improvements
---
## 🚀 **Ready to Start Teaching?**
### **First Class Preparation**
1. **Clone repository**: `git clone [repo_url]`
2. **Test your setup**: `tito system doctor`
3. **Review module 00**: `cat modules/00_setup/README.md`
4. **Open in Jupyter**: `jupyter lab modules/00_setup/setup_dev.py`
### **Your First Class**
```bash
cd modules/00_setup
jupyter lab setup_dev.py
# Guide students through setup_dev.py
# Watch them implement TODO sections
# Celebrate when tests pass!
```
**🎉 You're ready to teach TinyTorch! Start with module 00_setup and watch your students build their own ML framework.**

View File

@@ -2,107 +2,135 @@
**Complete documentation for the TinyTorch ML Systems course.**
## 🎯 **Quick Navigation**
### **For Students** 👨‍🎓
- **[Project Guide](students/project-guide.md)** - Complete course navigation and progress tracking
- **Start Here**: [`modules/setup/README.md`](../modules/setup/README.md) - First module setup
### **For Developers** 👨‍💻
- **[Development Guide](development/module-development-guide.md)** - Complete methodology and best practices
- **[Quick Reference](development/quick-module-reference.md)** - Commands and essential patterns
- **[Creation Checklist](development/module-creation-checklist.md)** - Step-by-step module creation
## 🎯 **Quick Start Navigation**
### **For Instructors** 👨‍🏫
- **[Pedagogical Principles](pedagogy/pedagogical-principles.md)** - Educational philosophy and learning theory
- **[Testing Architecture](pedagogy/testing-architecture.md)** - Assessment and verification strategy
- **[📖 Instructor Guide](INSTRUCTOR_GUIDE.md)** - Complete teaching guide with verified modules, commands, and class structure
- **[🎓 Pedagogy](pedagogy/)** - Educational principles and course philosophy
## 📁 **Documentation Structure**
### **For Students** 👨‍🎓
- **[🔥 Student Guide](STUDENT_GUIDE.md)** - Complete course navigation and learning path
- **[📚 Module README](../modules/)** - Individual module instructions and status
### **Development** (`development/`)
**For module developers and contributors**
- `module-development-guide.md` - Complete development methodology
- `quick-module-reference.md` - Fast reference for commands and patterns
- `module-creation-checklist.md` - Comprehensive step-by-step process
- `module-template.md` - Reusable template snippets
### **For Developers** 👨‍💻
- **[🛠️ Development](development/)** - Module creation and contribution guidelines
### **Students** (`students/`)
**For course participants**
- `project-guide.md` - Course navigation and module progression
## 📊 **Current Course Status**
### **Pedagogy** (`pedagogy/`)
**For instructors and educational design**
- `pedagogical-principles.md` - Educational philosophy and learning theory
- `testing-architecture.md` - Assessment strategy and testing patterns
- `vision.md` - Course vision and goals
### **✅ Ready for Students** (6+ weeks of content)
- **00_setup** (20/20 tests) - Development workflow & CLI tools
- **02_activations** (24/24 tests) - ReLU, Sigmoid, Tanh functions
- **03_layers** (17/22 tests) - Dense layers & neural building blocks
- **04_networks** (20/25 tests) - Sequential networks & MLPs
- **06_dataloader** (15/15 tests) - CIFAR-10 data loading
- **05_cnn** (2/2 tests) - Convolution operations
## 🚀 **Quick Commands Reference**
### **🚧 In Development**
- **01_tensor** (22/33 tests) - Tensor arithmetic (partially working)
- **07-13** - Advanced features (autograd, training, MLOps)
### **System Commands**
## 🚀 **Quick Commands**
### **System Status**
```bash
tito system info # System information and course navigation
tito system doctor # Environment diagnosis
tito system jupyter # Start Jupyter Lab
tito system info # Check system and module status
tito system doctor # Verify environment setup
tito module status # View all module progress
```
### **Module Development**
```bash
tito module status # Check all module status
tito module test --module X # Test specific module
tito module notebooks --module X # Convert Python to notebook
cd modules/00_setup # Navigate to module
jupyter lab setup_dev.py # Open development notebook
python -m pytest tests/ -v # Run module tests
python bin/tito module export 00_setup # Export to package
```
### **Package Management**
### **Package Usage**
```bash
tito package sync # Export notebooks to package
tito package sync --module X # Export specific module
tito package reset # Reset package to clean state
# Use student implementations
python -c "from tinytorch.core.utils import hello_tinytorch; hello_tinytorch()"
python -c "from tinytorch.core.activations import ReLU; print(ReLU()([-1, 0, 1]))"
```
## 🎓 **Educational Philosophy**
TinyTorch follows a **"Build → Use → Understand → Repeat"** methodology where students:
### **Build → Use → Understand → Repeat**
Students implement ML components from scratch, then immediately use their implementations:
1. **Build**: Implement `ReLU()` function
2. **Use**: Import `from tinytorch.core.activations import ReLU`
3. **Understand**: See how it works in real networks
4. **Repeat**: Each module builds on previous work
1. **Build** - Implement core ML components from scratch
2. **Use** - Apply their implementations to real problems
3. **Understand** - Reflect on design decisions and trade-offs
4. **Repeat** - Apply learnings to increasingly complex systems
### **Real Data, Real Systems**
- Work with CIFAR-10 (not toy datasets)
- Production-style code organization
- Performance and engineering considerations
### **Key Principles**
- **Real Data, Real Systems** - Use production datasets and realistic constraints
- **Progressive Complexity** - Build understanding step by step
- **Systems Thinking** - Connect to production ML engineering practices
- **Immediate Feedback** - Students see their code working quickly
### **Immediate Feedback**
- Tests provide instant verification
- Students see their code working quickly
- Progress is visible and measurable
## 🛠️ **Development Workflow**
## 📁 **Documentation Structure**
### **For New Modules**
1. **Plan** - Choose real datasets, define learning objectives
2. **Implement** - Write complete working version first
3. **Structure** - Add educational content and TODO guidance
4. **Test** - Comprehensive testing with real data
5. **Export** - Convert to notebooks and export to package
### **Quick Reference**
- **[INSTRUCTOR_GUIDE.md](INSTRUCTOR_GUIDE.md)** - Complete teaching guide
- **[STUDENT_GUIDE.md](STUDENT_GUIDE.md)** - Complete learning path
### **For Students**
1. **Setup** - Complete environment setup in `modules/setup/`
2. **Develop** - Work in `modules/{name}/{name}_dev.py` files
3. **Export** - Use `tito package sync` to build package
4. **Test** - Use `tito module test` to verify implementation
5. **Progress** - Use `tito module status` to track completion
### **Detailed Guides**
- **[pedagogy/](pedagogy/)** - Educational principles and course philosophy
- **[development/](development/)** - Module creation and development guidelines
## 📊 **Course Structure**
### **Legacy Documentation**
The `development/` directory contains detailed module creation guides that were used to build the current working modules. This documentation is preserved for reference but the main teaching workflow is now covered in the Instructor and Student guides.
TinyTorch is organized into progressive modules:
## 🌟 **Success Metrics**
- **Setup** - Development environment and workflow
- **Tensor** - Core data structures and operations
- **Layers** - Neural network building blocks
- **Networks** - Complete model architectures
- **Training** - Optimization and learning algorithms
- **Advanced** - Production systems and MLOps
### **Working Capabilities**
Students can currently:
- Build and test multi-layer perceptrons
- Implement custom activation functions
- Load and process CIFAR-10 data
- Create basic convolution operations
- Export their code to a working package
Each module builds on previous ones, creating a complete ML systems engineering curriculum.
### **Verified Workflows**
-**Instructor Journey**: develop → export → test → package
-**Student Journey**: import → use → build → understand
-**Package Integration**: All core imports work correctly
## 🔧 **Technical Details**
### **Module Structure**
Each module follows this pattern:
- `modules/XX_name/` - Module directory
- `XX_name_dev.py` - Development notebook (Jupytext format)
- `tests/` - Comprehensive test suite
- `README.md` - Module-specific instructions
### **Export System**
- Students develop in `XX_name_dev.py`
- Export to `tinytorch.core.XX_name` package
- Import and use their implementations immediately
---
**💡 Pro Tip**: Start with the [Project Guide](students/project-guide.md) if you're a student, or the [Development Guide](development/module-development-guide.md) if you're creating modules.
## 🚀 **Getting Started**
### **Instructors**
1. Read the [Instructor Guide](INSTRUCTOR_GUIDE.md)
2. Verify your system: `tito system doctor`
3. Test the first module: `cd modules/00_setup && jupyter lab setup_dev.py`
### **Students**
1. Read the [Student Guide](STUDENT_GUIDE.md)
2. Start with: `cd modules/00_setup && jupyter lab setup_dev.py`
3. Follow the 5-step workflow for each module
### **Developers**
1. Review the [development/](development/) directory
2. Follow existing module patterns
3. Test thoroughly before contributing
**🎉 TinyTorch is ready for classroom use with 6+ weeks of proven curriculum content!**

297
docs/STUDENT_GUIDE.md Normal file
View File

@@ -0,0 +1,297 @@
# 🔥 TinyTorch Student Guide
**Build Your Own Machine Learning Framework from Scratch**
Welcome to TinyTorch! You're about to build a complete ML framework from the ground up. By the end of this course, you'll have implemented your own neural networks, data loaders, and training systems - then used them to solve real problems.
## 🎯 **What You'll Build**
- **Your own ML framework** that you can `pip install` and use
- **Neural networks** that classify real images (CIFAR-10)
- **Data loading systems** that handle production datasets
- **Complete understanding** of how ML systems actually work
## 🚀 **Quick Start** (First 10 Minutes)
### **1. Get Started**
```bash
cd TinyTorch
tito system info # Check your system
tito system doctor # Verify everything works
```
### **2. Start Your First Module**
```bash
cd modules/00_setup
jupyter lab setup_dev.py
```
### **3. Complete the Setup**
- Follow the notebook instructions
- Complete the TODO sections
- Run the tests to verify your work
## 📚 **Course Progress Tracker**
Track your journey through TinyTorch:
### **✅ Ready to Start** (6+ weeks of content)
- [ ] **00_setup** - Development workflow & CLI tools
- [ ] **02_activations** - ReLU, Sigmoid, Tanh functions
- [ ] **03_layers** - Dense layers & neural building blocks
- [ ] **04_networks** - Sequential networks & MLPs
- [ ] **06_dataloader** - CIFAR-10 data loading
- [ ] **05_cnn** - Convolution operations
### **🚧 Coming Soon**
- [ ] **01_tensor** - Tensor arithmetic (partially working)
- [ ] **07_autograd** - Automatic differentiation
- [ ] **08_optimizers** - SGD, Adam optimizers
- [ ] **09_training** - Complete training loops
- [ ] **Future modules** - Advanced ML systems
## 🛠️ **Your Daily Workflow** (5 Simple Steps)
This is your rhythm for every module:
### **Step 1: Open Module**
```bash
cd modules/00_setup
jupyter lab setup_dev.py
```
### **Step 2: Learn & Implement**
- Read the markdown explanations
- Complete each TODO section
- Test your understanding as you go
### **Step 3: Export Your Code**
```bash
python bin/tito module export 00_setup
```
### **Step 4: Test Your Work**
```bash
python -m pytest modules/00_setup/tests/ -v
```
### **Step 5: Use Your Code**
```bash
python -c "from tinytorch.core.utils import hello_tinytorch; hello_tinytorch()"
```
**🎉 When all tests pass, you're ready for the next module!**
## 📋 **Module Details**
### **🔧 Module 00: Setup**
**Goal**: Learn the development workflow
**Time**: 30-45 minutes
**Tests**: 20/20 must pass
**What you'll build**:
- Development environment setup
- CLI tool familiarity
- Your first TinyTorch function
**Verification**:
```bash
tito system doctor # Should show all ✅
python -c "from tinytorch.core.utils import hello_tinytorch; hello_tinytorch()"
```
---
### **🧠 Module 02: Activations**
**Goal**: Build core ML math functions
**Prerequisites**: Module 00 complete
**Tests**: 24/24 must pass
**What you'll build**:
- ReLU activation function
- Sigmoid activation function
- Tanh activation function
- Understanding of neural network math
**Verification**:
```bash
python -c "from tinytorch.core.activations import ReLU; print(ReLU()([-1, 0, 1]))"
```
---
### **🏗️ Module 03: Layers**
**Goal**: Build neural network layers
**Prerequisites**: Module 02 complete
**Tests**: 17/22 passing (core features work)
**What you'll build**:
- Dense/Linear layers
- Parameter management
- Forward pass implementation
- Layer composition
**Verification**:
```bash
python -c "from tinytorch.core.layers import Dense; layer = Dense(10, 5); print(layer)"
```
---
### **🖼️ Module 04: Networks**
**Goal**: Build complete neural networks
**Prerequisites**: Module 03 complete
**Tests**: 20/25 passing (core features work)
**What you'll build**:
- Sequential network container
- Multi-layer perceptron (MLP)
- Network composition
- Model architecture design
**Verification**:
```bash
python -c "from tinytorch.core.networks import Sequential, create_mlp; net = create_mlp([10, 5, 1]); print(net)"
```
---
### **📊 Module 06: DataLoader**
**Goal**: Handle real production data
**Prerequisites**: Module 04 complete
**Tests**: 15/15 must pass
**What you'll build**:
- CIFAR-10 dataset loading
- Batch processing
- Data transformations
- Production data pipeline
**Verification**:
```bash
python -c "from tinytorch.core.dataloader import DataLoader; loader = DataLoader('cifar10'); print(next(loader))"
```
---
### **🔍 Module 05: CNN**
**Goal**: Basic convolution operations
**Prerequisites**: Module 06 complete
**Tests**: 2/2 must pass
**What you'll build**:
- Conv2D layer implementation
- Basic convolution math
- Image processing foundations
**Verification**:
```bash
python -c "from tinytorch.core.cnn import Conv2D; conv = Conv2D(3, 16, 3); print(conv)"
```
## 🆘 **Getting Help**
### **Tests Are Failing?**
```bash
cd modules/XX
python -m pytest tests/ -v # See detailed error messages
```
### **Can't Import Your Code?**
```bash
python bin/tito module export XX # Re-export your module
tito package sync # Sync all modules
```
### **Environment Issues?**
```bash
tito system doctor # Check your environment
source .venv/bin/activate # Activate virtual environment
```
### **General Debugging**
```bash
tito system info # Check system status
tito module status # See all module progress
```
## 💡 **Study Tips**
### **Start Small**
- Complete one TODO section at a time
- Test your code frequently
- Use `print()` statements to debug
### **Build Understanding**
- Read the markdown explanations carefully
- Connect new concepts to previous modules
- Try variations of the examples
### **Use Real Data**
- Work with CIFAR-10 (not toy datasets)
- See how your code handles realistic problems
- Understand performance implications
### **Celebrate Progress**
- Each passing test is a victory
- You're building real ML systems
- Your code becomes part of a working framework
## 🏆 **Success Milestones**
### **Week 1-2: Foundation**
- [ ] Complete setup and activations
- [ ] Understand development workflow
- [ ] See your first neural network math working
### **Week 3-4: Building Blocks**
- [ ] Build complete neural network layers
- [ ] Compose layers into networks
- [ ] Create your first MLP
### **Week 5-6: Real Systems**
- [ ] Load and process CIFAR-10 data
- [ ] Build basic convolution operations
- [ ] Train networks on real images
### **Beyond: Advanced Features**
- [ ] Complete tensor arithmetic
- [ ] Implement automatic differentiation
- [ ] Build training loops and optimizers
## 🎓 **Learning Philosophy**
### **Build → Use → Understand → Repeat**
1. **Build**: You implement `ReLU()` from scratch
2. **Use**: You immediately use `from tinytorch.core.activations import ReLU`
3. **Understand**: You see how it works in real networks
4. **Repeat**: Each module builds on this foundation
### **Real Data, Real Systems**
- Work with CIFAR-10 (10,000 real images)
- Handle production-scale datasets
- Build systems that actually work
### **Immediate Feedback**
- Tests show you're on the right track
- Your code exports to a real package
- You can use your implementations immediately
---
## 🚀 **Ready to Start?**
### **Your First Session**
1. **Open terminal**: `cd TinyTorch`
2. **Check system**: `tito system doctor`
3. **Start module**: `cd modules/00_setup && jupyter lab setup_dev.py`
4. **Follow instructions**: Complete the TODO sections
5. **Test your work**: `python -m pytest tests/ -v`
### **When You're Stuck**
- Read the error messages carefully
- Check the module README: `cat modules/XX/README.md`
- Ask your instructor for help
- Remember: everyone gets stuck sometimes!
**🎉 You're about to build your own ML framework. Let's start with module 00_setup!**