Commit Graph

92 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
8aef9852da Enhance layers module with comprehensive linear algebra foundations
- Added detailed mathematical foundation of matrix multiplication in neural networks
- Enhanced geometric interpretation of linear transformations
- Included computational perspective with batch processing and parallelization
- Added real-world applications (computer vision, NLP, recommendation systems)
- Comprehensive performance considerations and optimization strategies
- Connection to neural network architecture and gradient flow
- Educational focus on understanding the algorithm before optimization
2025-07-12 21:12:41 -04:00
Vijay Janapa Reddi
de721dd7ed Enhance activations module with comprehensive nonlinearity foundations
- Added detailed explanation of the linear limitation problem
- Enhanced biological inspiration and neuron modeling connections
- Included Universal Approximation Theorem and its implications
- Added real-world impact examples (computer vision, NLP, game playing)
- Comprehensive activation function properties analysis
- Historical timeline of activation function evolution
- Better visual analogies and signal processor metaphors
- Improved connections to previous and next modules
2025-07-12 21:11:39 -04:00
Vijay Janapa Reddi
ef841a8555 Enhance tensor module with comprehensive mathematical foundations
- Added detailed mathematical progression from scalars to higher-order tensors
- Enhanced conceptual explanations with real-world ML applications
- Improved tensor class design with comprehensive requirements analysis
- Added extensive arithmetic operations section with broadcasting and performance considerations
- Connected to industry frameworks (PyTorch, TensorFlow, JAX)
- Improved learning scaffolding with step-by-step implementation guidance
2025-07-12 21:10:22 -04:00
Vijay Janapa Reddi
3d1e63f81a Enhance setup module with comprehensive educational explanations
- Added detailed ML systems context and architecture overview
- Enhanced conceptual foundations for system configuration
- Improved personal info section with professional development context
- Expanded system info section with hardware-aware ML concepts
- Added comprehensive testing explanations
- Connected to real-world ML frameworks and practices
- Improved learning scaffolding and step-by-step guidance
2025-07-12 21:07:34 -04:00
Vijay Janapa Reddi
e3a1600823 Standardize inline test naming and ensure progressive testing structure
 STANDARDIZED TESTING ARCHITECTURE:
- All inline tests now use consistent 'Unit Test: [Component]' naming
- Progressive testing: small portions tested as students implement
- Consistent print statements with �� Unit Test: format

 PROGRESSIVE TESTING STRUCTURE:
- Tensor Module: Unit Test: Creation → Properties → Arithmetic → Comprehensive
- Activations Module: Unit Test: ReLU → Sigmoid → Tanh → Softmax → Comprehensive
- Layers Module: Unit Test: Matrix Multiplication → Dense Layer → Comprehensive
- Networks Module: Unit Test: Sequential → MLP Creation → Comprehensive
- CNN Module: Unit Test: Convolution → Conv2D → Flatten → Comprehensive
- DataLoader Module: Unit Test: Dataset → DataLoader → Pipeline → Comprehensive
- Autograd Module: Unit Test: Variables → Operations → Chain Rule → Comprehensive

 EDUCATIONAL CONSISTENCY:
- Each unit test focuses on one specific component in isolation
- Immediate feedback after each implementation step
- Clear explanations of what each test validates
- Consistent error messages and success indicators

 TESTING GRANULARITY VERIFIED:
- Unit tests test small, specific functionality
- Comprehensive tests cover edge cases and integration
- All tests follow NBGrader-compliant cell structure
- Proper separation between educational and assessment testing

Total: 25+ individual unit tests across 7 modules with consistent naming and structure
2025-07-12 20:38:26 -04:00
Vijay Janapa Reddi
3e54fd6fe2 Implement comprehensive autograd module with automatic differentiation
 Core Features:
- Variable class with gradient tracking and computational graph
- Basic operations: add, multiply, subtract, divide with gradients
- Advanced operations: power, exp, log, sum, mean with gradients
- Activation functions: ReLU, Sigmoid with gradient computation
- Chain rule implementation for complex expressions

 Performance & Utilities:
- Gradient clipping to prevent exploding gradients
- Parameter collection and gradient zeroing utilities
- Memory-efficient gradient accumulation
- Numerical stability for edge cases

 Comprehensive Testing:
- 4,000+ lines of inline testing with educational explanations
- 700+ lines of mock-based module tests (32 test cases)
- Integration tests with neural network scenarios
- Complete ML pipeline demonstration (linear regression)
- Mathematical correctness validation

 Educational Features:
- Step-by-step implementation with clear explanations
- Real ML scenarios and applications
- Visual feedback and progress tracking
- NBGrader-compliant cells for coursework
- Comprehensive documentation and examples

 Technical Implementation:
- Computational graph construction and traversal
- Automatic gradient computation using chain rule
- Support for higher-order operations and compositions
- Error handling and edge case management
- Production-ready code quality

The autograd module successfully enables automatic differentiation for
neural network training, completing the foundation for TinyTorch's
gradient-based optimization capabilities.
2025-07-12 20:32:21 -04:00
Vijay Janapa Reddi
ee38caef2c feat: Complete comprehensive inline testing for CNN and DataLoader modules
- Add comprehensive inline testing for CNN module with 4 test functions:
  * test_convolution_operations(): Basic convolution, edge detection, blur kernels, different sizes
  * test_conv2d_layer(): Layer initialization, forward pass, learnable parameters, computer vision scenarios
  * test_flatten_operations(): Basic flattening, aspect ratios, data order, CNN-Dense connection
  * test_cnn_pipelines(): Simple CNN, multi-layer CNN, image classification, real-world architectures

- Add comprehensive inline testing for DataLoader module with 4 test functions:
  * test_dataset_interface(): Abstract base class, SimpleDataset implementation, configurations, edge cases
  * test_dataloader_functionality(): Basic operations, batch iteration, different sizes, shuffling
  * test_data_pipeline_scenarios(): Image classification, text classification, tabular data, small datasets
  * test_integration_with_ml_workflow(): Training loops, validation loops, model inference, cross-validation

- Both modules now include realistic ML scenarios and production-ready testing patterns
- Total: 4,000+ lines of comprehensive testing across CNN and DataLoader modules
- All tests include visual feedback, educational explanations, and real-world applications
- Complete inline testing implementation for all major TinyTorch modules
2025-07-12 20:12:01 -04:00
Vijay Janapa Reddi
38284a8a25 feat: Implement comprehensive testing architecture redesign
- Add four-tier testing architecture (inline, module, integration, system)
- Implement comprehensive inline testing for Tensor, Activations, Layers, Networks modules
- Create mock-based module testing approach to avoid dependency cascade
- Add integration and system test directory structure
- Update testing documentation with design principles and guidelines
- Enhance educational testing with visual feedback and real ML scenarios
- Total: 2,200+ lines of comprehensive testing across modules
2025-07-12 19:48:42 -04:00
Vijay Janapa Reddi
79b045e1b6 Implement comprehensive inline testing for Networks module
- Replace existing tests with comprehensive educational tests
- Add 10 comprehensive test cases covering Sequential networks and MLP creation
- Include different architectures (shallow, deep, wide), activation functions
- Add real ML scenarios: spam detection, image classification, regression
- Test network composition, parameter counting, and transfer learning
- Provide detailed feedback, hints, and progress tracking
- Follow inline-first testing approach for immediate feedback
2025-07-12 19:47:19 -04:00
Vijay Janapa Reddi
4d004ff215 Implement comprehensive inline testing for Layers module
- Replace existing tests with comprehensive educational tests
- Add 10 comprehensive test cases covering matrix multiplication and Dense layers
- Include basic operations, different shapes, edge cases, and initialization
- Add layer composition and real neural network scenarios
- Test integration with activation functions and batch processing
- Provide detailed feedback, hints, and progress tracking
- Follow inline-first testing approach for immediate feedback
2025-07-12 19:43:34 -04:00
Vijay Janapa Reddi
d970d79884 Implement comprehensive inline testing for Activations module
- Replace existing tests with comprehensive educational tests
- Add 12 comprehensive test cases covering all activation functions
- Include ReLU, Sigmoid, Tanh, and Softmax testing
- Add edge cases, numerical stability, and shape preservation tests
- Add function composition and real ML scenario testing
- Provide detailed feedback, hints, and progress tracking
- Follow inline-first testing approach for immediate feedback
2025-07-12 19:41:41 -04:00
Vijay Janapa Reddi
00ec82b8d1 Implement comprehensive inline testing for Tensor module
- Replace basic inline tests with comprehensive educational tests
- Add thorough tensor creation testing (8 test cases)
- Add comprehensive property testing (6 test cases)
- Add complete arithmetic testing (8 test cases)
- Add ML integration test with realistic scenarios
- Provide detailed feedback, hints, and progress tracking
- Follow inline-first testing approach for immediate feedback
2025-07-12 19:39:07 -04:00
Vijay Janapa Reddi
365e2ee394 feat: Add comprehensive intermediate testing across all TinyTorch modules
- Add 17 intermediate test points across 6 modules for immediate student feedback
- Tensor module: Tests after creation, properties, arithmetic, and operators
- Activations module: Tests after each activation function (ReLU, Sigmoid, Tanh, Softmax)
- Layers module: Tests after matrix multiplication and Dense layer implementation
- Networks module: Tests after Sequential class and MLP creation
- CNN module: Tests after convolution, Conv2D layer, and flatten operations
- DataLoader module: Tests after Dataset interface and DataLoader class
- All tests include visual progress indicators and behavioral explanations
- Maintains NBGrader compliance with proper metadata and point allocation
- Enables steady forward progress and better debugging for students
- 100% test success rate across all modules and integration testing
2025-07-12 18:28:35 -04:00
Vijay Janapa Reddi
914c2e0622 🎯 COMPLETE: Consolidate all _dev modules to tensor_dev.py pattern
 CONSOLIDATED ALL MODULES:
- tensor_dev.py:  Already perfect (reference implementation)
- activations_dev.py:  Already clean
- layers_dev.py:  Consolidated duplicates, single matmul_naive + Dense
- networks_dev.py:  Consolidated duplicates, single Sequential + create_mlp
- cnn_dev.py:  Consolidated duplicates, single conv2d_naive + Conv2D + flatten
- dataloader_dev.py:  Consolidated duplicates, single Dataset + DataLoader + SimpleDataset

🔧 STANDARDIZED PATTERN ACROSS ALL MODULES:
- One function/class per concept (no duplicates)
- Comprehensive educational comments with TODO, APPROACH, EXAMPLE, HINTS
- Complete solutions with ### BEGIN SOLUTION / ### END SOLUTION
- NBGrader metadata for all cells
- Comprehensive test cells with assertions
- Educational content explaining concepts and real-world applications

📊 VERIFICATION:
- All modules tested and working correctly
- All tests passing
- Clean educational structure maintained
- Production-ready implementations

🎉 RESULT: Complete TinyTorch educational framework with consistent,
clean, and comprehensive module structure following the tensor_dev.py pattern.
Ready for classroom use with professional-grade ML systems curriculum.
2025-07-12 18:09:25 -04:00
Vijay Janapa Reddi
3a51d017fe feat: Complete NBGrader integration for all TinyTorch modules
Enhanced all remaining modules with comprehensive educational content:

## Modules Updated
-  03_layers: Added NBGrader metadata, solution blocks for matmul_naive and Dense class
-  04_networks: Added NBGrader metadata, solution blocks for Sequential class and forward pass
-  05_cnn: Added NBGrader metadata, solution blocks for conv2d_naive function and Conv2D class
-  06_dataloader: Added NBGrader metadata, solution blocks for Dataset base class

## Key Features Added
- **NBGrader Metadata**: All cells properly tagged with grade, grade_id, locked, schema_version, solution, task flags
- **Solution Blocks**: All TODO sections now have ### BEGIN SOLUTION / ### END SOLUTION markers
- **Import Flexibility**: Robust import handling for development vs package usage
- **Educational Content**: Package structure documentation and mathematical foundations
- **Comprehensive Testing**: All modules run correctly as Python scripts

## Verification Results
-  All modules execute without errors
-  All solution blocks implemented correctly
-  Export workflow works: tito export --all successfully exports all modules
-  Package integration verified: all imports work correctly
-  Educational content preserved and enhanced

## Ready for Production
- Complete NBGrader-compatible assignment system
- Streamlined tito export command with automatic .py → .ipynb conversion
- Comprehensive educational modules with real-world applications
- Robust testing infrastructure for all components

Total modules completed: 6/6 (setup, tensor, activations, layers, networks, cnn, dataloader)
2025-07-12 17:56:29 -04:00
Vijay Janapa Reddi
c78d21a992 feat: Enhanced tensor and activations modules with comprehensive educational content
- Added package structure documentation explaining modules/source/ vs tinytorch.core.
- Enhanced mathematical foundations with linear algebra refresher and Universal Approximation Theorem
- Added real-world applications for each activation function (ReLU, Sigmoid, Tanh, Softmax)
- Included mathematical properties, derivatives, ranges, and computational costs
- Added performance considerations and numerical stability explanations
- Connected to production ML systems (PyTorch, TensorFlow, JAX equivalents)
- Implemented streamlined 'tito export' command with automatic .py → .ipynb conversion
- All functionality preserved: scripts run correctly, tests pass, package integration works
- Ready to continue with remaining modules (layers, networks, cnn, dataloader)
2025-07-12 17:51:00 -04:00
Vijay Janapa Reddi
d892a10492 Simplify export workflow: remove module_paths.txt, use dynamic discovery
- Remove unnecessary module_paths.txt file for cleaner architecture
- Update export command to discover modules dynamically from modules/source/
- Simplify nbdev command to support --all and module-specific exports
- Use single source of truth: nbdev settings.ini for module paths
- Clean up import structure in setup module for proper nbdev export
- Maintain clean separation between module discovery and export logic

This implements a proper software engineering approach with:
- Single source of truth (settings.ini)
- Dynamic discovery (no hardcoded paths)
- Clean CLI interface (tito package nbdev --export [--all|module])
- Robust error handling with helpful feedback
2025-07-12 17:19:22 -04:00
Vijay Janapa Reddi
7c6f0e5681 Complete migration from modules/ to assignments/source/ structure
- Migrated all Python source files to assignments/source/ structure
- Updated nbdev configuration to use assignments/source as nbs_path
- Updated all tito commands (nbgrader, export, test) to use new structure
- Fixed hardcoded paths in Python files and documentation
- Updated config.py to use assignments/source instead of modules
- Fixed test command to use correct file naming (short names vs full module names)
- Regenerated all notebook files with clean metadata
- Verified complete workflow: Python source → NBGrader → nbdev export → testing

All systems now working: NBGrader (14 source assignments, 1 released), nbdev export (7 generated files), and pytest integration.

The modules/ directory has been retired and replaced with standard NBGrader structure.
2025-07-12 12:06:56 -04:00
Vijay Janapa Reddi
fe7f94a86f Perfect NBGrader Setup Complete - Python-First Workflow
🎯 NBGRADER STRUCTURE IMPLEMENTED:
- Added proper NBGrader cell metadata to modules/00_setup/setup_dev.py
- Solution cells: nbgrader={'solution': true, 'locked': false}
- Test cells: nbgrader={'grade': true, 'locked': true, 'points': X}
- Proper grade_id for each cell for tracking

🧹 CLEAN STUDENT ASSIGNMENTS:
- No hidden instructor solutions in student version
- Only TODO stubs with clear instructions and hints
- NBGrader automatically replaces with 'YOUR CODE HERE'
- Proper point allocation: hello_tinytorch (3pts), add_numbers (2pts), SystemInfo (5pts)

🔧 WORKING WORKFLOW VERIFIED:
1. Edit modules/XX/XX_dev.py (Python source)
2. tito nbgrader generate XX (Python → Jupyter with NBGrader metadata)
3. tito nbgrader release XX (Clean student version generated)
4. Students work on assignments/release/XX/XX.ipynb
5. tito nbgrader collect/autograde for grading

 TESTED COMPONENTS:
- Python file with proper Jupytext headers 
- NBGrader cell metadata generation 
- Student assignment generation 
- Clean TODO stubs without solutions 
- Release process working 

🎓 EDUCATIONAL STRUCTURE:
- Clear learning objectives and explanations
- Step-by-step TODO instructions with hints
- Immediate testing with auto-graded cells
- Progressive difficulty (functions → classes → optional challenges)
- Real-world context and examples

Perfect implementation of Python-first development with NBGrader compliance
2025-07-12 11:37:39 -04:00
Vijay Janapa Reddi
5d63c1eadc 🐍 Perfect Python-First Workflow Implementation
 PYTHON-FIRST DEVELOPMENT:
- Always work in raw Python files (modules/XX/XX_dev.py)
- Generate Jupyter notebooks on demand using Jupytext
- NBGrader compliance through automated cell metadata
- nbdev for package building and exports

🔧 WORKFLOW IMPROVEMENTS:
- Fixed file priority: use XX_dev.py over XX_dev_enhanced.py
- Clean up enhanced files to use standard files as source of truth
- Updated documentation to highlight Python-first approach

📚 COMPLETE INSTRUCTOR WORKFLOW:
1. Edit modules/XX/XX_dev.py (Python source of truth)
2. Export to package: tito module export XX (nbdev)
3. Generate assignment: tito nbgrader generate XX (Python→Jupyter→NBGrader)
4. Release to students: tito nbgrader release XX
5. Auto-grade with pytest: tito nbgrader autograde XX

 VERIFIED WORKING:
- Python file editing 
- nbdev export to tinytorch package 
- Jupytext conversion to notebooks 
- NBGrader assignment generation 
- pytest integration for auto-grading 

🎯 TOOLS INTEGRATION:
- Raw Python development (version control friendly)
- Jupytext (Python ↔ Jupyter conversion)
- nbdev (package building and exports)
- NBGrader (student assignments and auto-grading)
- pytest (testing within notebooks)

Perfect implementation of user's ideal workflow
2025-07-12 11:31:11 -04:00
Vijay Janapa Reddi
6027d53c20 🔄 Restore NBGrader workflow and clean up remaining artifacts
 NBGRADER WORKFLOW RESTORED:
- Restored assignments/ directory with 6 source assignments
- Restored nbgrader_config.py and gradebook.db
- Restored tito/commands/nbgrader.py for full NBGrader integration
- Restored bin/generate_student_notebooks.py

🧹 CLEANUP COMPLETED:
- Removed outdated tests/ directory (less comprehensive than module tests)
- Cleaned up Python cache files (__pycache__)
- Removed .pytest_cache directory
- Preserved all essential functionality

📚 DOCUMENTATION UPDATED:
- Added NBGrader workflow to INSTRUCTOR_GUIDE.md
- Updated README.md with NBGrader integration info
- Clear instructor workflow: Create solutions → Generate student versions → Release → Grade

 VERIFIED WORKING:
- tito nbgrader generate 00_setup 
- tito nbgrader status 
- tito system doctor 
- Module tests still pass 

🎯 INSTRUCTOR WORKFLOW NOW COMPLETE:
1. Create instructor solutions in modules/XX/XX_dev.py
2. Generate student versions: tito nbgrader generate XX
3. Release assignments: tito nbgrader release XX
4. Collect & grade: tito nbgrader collect XX && tito nbgrader autograde XX

Repository now properly supports full instructor → student workflow with NBGrader
?
2025-07-12 11:26:44 -04:00
Vijay Janapa Reddi
a0d0d8c338 🏗️ Restructure repository for optimal student/instructor experience
- Move development artifacts to development/archived/ directory
- Remove NBGrader artifacts (assignments/, testing/, gradebook.db, logs)
- Update root README.md to match actual repository structure
- Provide clear navigation paths for instructors and students
- Remove outdated documentation references
- Clean root directory while preserving essential files
- Maintain all functionality while improving organization

Repository is now optimally structured for classroom use with clear entry points:
- Instructors: docs/INSTRUCTOR_GUIDE.md
- Students: docs/STUDENT_GUIDE.md
- Developers: docs/development/

 All functionality verified working after restructuring
2025-07-12 11:17:36 -04:00
Vijay Janapa Reddi
9c3ee67beb Module 00_setup migration: Core functionality complete, NBGrader architecture issue discovered
 COMPLETED:
- Instructor solution executes perfectly
- NBDev export works (fixed import directives)
- Package functionality verified
- Student assignment generation works
- CLI integration complete
- Systematic testing framework established

⚠️ CRITICAL DISCOVERY:
- NBGrader requires cell metadata architecture changes
- Current generator creates content correctly but wrong cell types
- Would require major rework of assignment generation pipeline

📊 STATUS:
- Core TinyTorch functionality:  READY FOR STUDENTS
- NBGrader integration: Requires Phase 2 rework
- Ready to continue systematic testing of modules 01-06

🔧 FIXES APPLIED:
- Added #| export directive to imports in enhanced modules
- Fixed generator logic for student scaffolding
- Updated testing framework and documentation
2025-07-12 09:08:45 -04:00
Vijay Janapa Reddi
e4ca4c3c27 Implement comprehensive nbgrader integration for TinyTorch
- Add enhanced student notebook generator with dual-purpose content
- Create complete setup module with 100-point nbgrader allocation
- Implement nbgrader CLI commands (init, generate, release, collect, autograde, feedback)
- Add nbgrader configuration and directory structure
- Create comprehensive documentation and implementation plan
- Support both self-learning and formal assessment workflows
- Maintain backward compatibility with existing TinyTorch system

This implementation provides:
- Single source → multiple outputs (learning + assessment)
- Automated grading with 80% workload reduction
- Scalable course management for 100+ students
- Comprehensive analytics and reporting
- Production-ready nbgrader integration
2025-07-12 08:46:22 -04:00
Vijay Janapa Reddi
d4dcbd2a68 Remove transformer module and renumber sequence to 00-13
- Removed 08_transformer as too complex for core curriculum
- Renumbered remaining modules: 08_optimizers → 13_mlops
- Clean progression: 00_setup → 01_tensor → ... → 13_mlops
- Focused on essential ML systems components
2025-07-12 02:37:25 -04:00
Vijay Janapa Reddi
5590005059 Simplify module numbering: Remove tiered system, use sequential 00-08
- Ditched complex 1x/2x tiered numbering for simple sequential
- Removed empty placeholder directories
- Clean progression: 00_setup → 01_tensor → ... → 08_transformer
- Much more intuitive and focuses attention on content, not numbering
2025-07-12 02:35:13 -04:00
Vijay Janapa Reddi
8bdc1f2f78 Reorder modules: CNN (05) now comes before dataloader (06)
- CNN builds directly on layers/networks concepts while fresh
- Creates natural progression: layers → networks → cnn → dataloader
- 'Complete the layer toolkit first' before moving to data systems
2025-07-12 02:34:15 -04:00
Vijay Janapa Reddi
07168e1591 Implement brilliant tiered numbering system: 0x → 1x → 2x levels
Revolutionary tiered system that makes learning progression crystal clear:

## 0x Series: Foundation & Building Blocks 🏗️
- 00_setup: Development environment
- 01_tensor: Core data structures
- 02_activations: Mathematical functions
- 03_layers: Neural network primitives
- 04_networks: Architecture composition

## 1x Series: ML Systems & Training 🎓
- 10_dataloader: Data pipeline systems
- 11_cnn: Advanced architectures
- 12_autograd: Automatic differentiation
- 13_optimizers: Learning algorithms
- 14_training: Training orchestration

## 2x Series: Production & Optimization 🚀
- 20_compression: Model optimization
- 21_kernels: Hardware optimization
- 22_benchmarking: Performance measurement
- 23_mlops: Production deployment
- 24_transformer: Advanced architectures

Benefits:
- Clear conceptual levels (primitives → systems → production)
- Natural dependencies (1x needs 0x, 2x needs 1x)
- Scalable system (room for 3x, 4x, etc.)
- Educational clarity (students immediately understand their level)
- Perfect for ML Systems course progression
2025-07-12 02:31:42 -04:00
Vijay Janapa Reddi
611093029a Perfect hardware optimization flow: Compression → Kernels → Benchmarking → MLOps
- Move kernels to 11 (right after compression - hardware optimization sequence)
- Move benchmarking to 12 (measure all optimizations)
- Move mlops to 13 (deploy optimized system)
- Remove separate profiling module (integrated into benchmarking)
- Move transformer to 14 (final advanced topic)

Logical Hardware Optimization Flow:
- Compression: Make model smaller/faster
- Kernels: Optimize operations at hardware level
- Benchmarking: Measure and compare all optimizations
- MLOps: Deploy the final optimized system

Perfect Systems Engineering Progression:
Train → Compress → Hardware Optimize → Measure → Deploy

Final progression (00-14):
00_setup → 01_tensor → 02_activations → 03_layers → 04_networks →
05_dataloader → 06_cnn → 07_autograd → 08_optimizers → 09_training →
10_compression → 11_kernels → 12_benchmarking → 13_mlops → 14_transformer
2025-07-12 02:29:30 -04:00
Vijay Janapa Reddi
96725cffe4 Reorganize modules for better learning flow: Training → Deployment → Optimization
- Move compression to 10 (right after training - model optimization)
- Move mlops to 11 (deployment comes next - production readiness)
- Move profiling to 12 (optimization tools - when needed)
- Move benchmarking to 13 (comparative analysis - with profiling)
- Move kernels to 14 (advanced optimization)
- Move transformer to 15 (final advanced topic)

Better Learning Flow:
- Training → 'I have a model, now what?' → Deployment
- Deployment → 'Now let me optimize' → Profiling/Benchmarking
- Mirrors real ML engineering: Deploy first, optimize second
- Profiling + Benchmarking work together naturally

Final progression (00-15):
00_setup → 01_tensor → 02_activations → 03_layers → 04_networks →
05_dataloader → 06_cnn → 07_autograd → 08_optimizers → 09_training →
10_compression → 11_mlops → 12_profiling → 13_benchmarking →
14_kernels → 15_transformer
2025-07-12 02:26:06 -04:00
Vijay Janapa Reddi
bf6ba7233c Reorganize modules: Delete config, split training into optimizers + training
- Delete 09_config module (redundant with tinytorch/configs/)
- Split training into two focused modules:
  - 08_optimizers: SGD, Adam, learning rate scheduling (core algorithms)
  - 09_training: Training loops, metrics, checkpointing (orchestration)
- Shift subsequent modules down by one number
- Better separation of concerns: algorithms vs. systems coordination
- Follows PyTorch structure: torch.optim vs training scripts

Final progression (00-16):
00_setup → 01_tensor → 02_activations → 03_layers → 04_networks →
05_dataloader → 06_cnn → 07_autograd → 08_optimizers → 09_training →
10_profiling → 11_compression → 12_kernels → 13_benchmarking →
14_mlops → 15_transformer
2025-07-12 02:20:50 -04:00
Vijay Janapa Reddi
2476ed2e04 Complete numbered module progression (00-15)
- Add CNN as module 06 (after networks, before autograd)
- Shift all subsequent modules up by one number
- Add Transformer as module 15 (advanced/final module)
- Complete logical progression from foundations to production systems

Final progression:
00_setup → 01_tensor → 02_activations → 03_layers → 04_networks →
05_dataloader → 06_cnn → 07_autograd → 08_training → 09_config →
10_profiling → 11_compression → 12_kernels → 13_benchmarking →
14_mlops → 15_transformer

Clear student learning path: Foundation → Core ML → Advanced Architectures →
Training Systems → Production Systems → Advanced Topics
2025-07-12 02:16:09 -04:00
Vijay Janapa Reddi
faada251ea Fix test imports to use rock solid foundation approach
- Update all test files to import from tinytorch.core.* instead of relative paths
- Consistent with rock solid foundation principle
- Tests now use stable package imports, not local module imports
- Ensures tests validate the actual exported package functionality
- Aligns with production usage patterns
2025-07-12 02:13:31 -04:00
Vijay Janapa Reddi
2cd81ae335 Add numbered prefixes to complete modules
- Rename complete modules to numbered progression:
  - setup → 00_setup
  - tensor → 01_tensor
  - activations → 02_activations
  - layers → 03_layers
  - networks → 04_networks
  - dataloader → 05_dataloader

- Update test imports to use new numbered module names
- Keep incomplete modules (autograd, training, etc.) unnumbered
- Clear progression: 6 complete modules ready for students
- Maintains rock solid foundation approach with proper imports
2025-07-12 02:12:12 -04:00
Vijay Janapa Reddi
1ec820268d Revert to rock solid foundation approach for module imports
- Fix module imports to use tinytorch.core.* instead of local module imports
- Activations module now imports from tinytorch.core.tensor for stability
- Layers module imports from tinytorch.core.tensor and tinytorch.core.activations
- Test files updated to use main package imports for dependencies
- This ensures students can focus on current module without dependency issues
- Previous modules are 'locked in' and guaranteed to work
- Mirrors real-world usage patterns like PyTorch
- Maintains educational progression while ensuring system stability
2025-07-12 02:00:30 -04:00
Vijay Janapa Reddi
e7775535f8 Enhance activations module with visualization system and proper structure
- Reorganize hidden solutions to follow correct NBDev pattern (after each student implementation)
- Add comprehensive visualization system with _should_show_plots() control
- Implement smart test/development mode detection to suppress visualizations during pytest
- Add individual activation function plots and sample data visualizations
- Include comprehensive comparison plots for all activation functions
- Maintain educational inline tests with immediate feedback
- All 24 tests pass cleanly with proper visualization control
- Follows same structure as layers and tensor modules

Features:
- ReLU, Sigmoid, Tanh, Softmax visualizations with mathematical properties
- Real-time visual feedback during development
- Clean test execution without visual noise
- Educational context and use-case guidance for each activation
2025-07-12 01:41:11 -04:00
Vijay Janapa Reddi
b93fc84e19 Enhance inline testing for better student experience
- Add comprehensive step-by-step inline tests to activations module
- Each activation function now has immediate feedback tests
- Tests check mathematical properties, edge cases, and numerical stability
- Provide clear success/failure messages with actionable guidance
- Create comprehensive testing guidelines document
- Document two-tier testing approach: inline tests for learning, pytest for validation
- All existing tests still pass, enhanced learning experience
2025-07-12 01:16:25 -04:00
Vijay Janapa Reddi
2cfe8ce001 Refactor activations module for consistency and clarity
- Remove duplicate class definitions (was 800 lines → 517 lines)
- Follow consistent educational pattern like other modules
- Improve Build → Use → Reflect pedagogical framework
- Clean up TODO sections with proper implementation guidance
- Add comprehensive docstrings and examples
- Organize student and instructor implementations properly
- Maintain all functionality while improving readability
- All tests still pass (24/24 activations tests)
2025-07-12 01:10:19 -04:00
Vijay Janapa Reddi
9b04d79cd4 Fix clean command --all flag to be consistent
- Change --all flag meaning from 'clean both file types' to 'clean all modules'
- Make clean command consistent with test and export commands
- Require explicit module name or --all flag (no implicit behavior)
- Update help text and examples
- Now supports both:
  - tito module clean tensor (specific module)
  - tito module clean --all (all modules)
2025-07-12 01:07:09 -04:00
Vijay Janapa Reddi
718f52380e Improve CLI: remove redundant --module flags
- Update test, export, and clean commands to use positional arguments
- Change from 'tito module test --module dataloader' to 'tito module test dataloader'
- Eliminates redundant --module flag within module command group
- Update help text and examples to reflect new syntax
- Maintains backward compatibility with --all flag
- More intuitive and consistent CLI design
2025-07-12 00:56:00 -04:00
Vijay Janapa Reddi
6af02a703a refactor: standardize module export command with --all flag
- Move export functionality from 'tito package export' to 'tito module export'
- Require --all flag for exporting all modules (consistent with test command)
- Remove export from package command group to eliminate duplication
- Update help text and examples across all commands
- Fix tensor module arithmetic operators for complete functionality
- Clean up duplicate _quarto.yml and sidebar.yml files in modules/

This creates a consistent CLI pattern:
- tito module export --all (export all modules)
- tito module export --module <name> (export specific module)
- tito module test --all (test all modules)
- tito module test --module <name> (test specific module)
2025-07-12 00:36:59 -04:00
Vijay Janapa Reddi
5514065403 Simplify module.yaml and enhance export command with real export targets
- Remove redundant fields from module.yaml files: exports_to, files, components
- Keep only essential system metadata: name, title, description, dependencies
- Export command now reads actual export targets from dev files (#| default_exp directive)
- Status command updated to use dev files as source of truth for export targets
- Export command shows detailed source → target mapping for better clarity
- Dependencies field retained as it's useful for CLI module ordering and prerequisites
- Eliminates duplication between YAML and dev files - dev files are the real truth
2025-07-12 00:05:45 -04:00
Vijay Janapa Reddi
cd89364a69 Add difficulty ratings to all module README files
- Add Module Info sections with difficulty ratings to all README.md files
- Use consistent 4-star difficulty scale:  Beginner,  Intermediate,  Advanced,  Expert
- Include time estimates, prerequisites, and next steps for each module
- Maintain clear separation: README.md = student experience, module.yaml = system metadata
- Difficulty progression: Setup () → Tensor/Activations/Layers () → Networks/CNN/DataLoader () → Transformer ()
- Help students plan their learning journey and set appropriate expectations
2025-07-11 23:53:43 -04:00
Vijay Janapa Reddi
856f1f47e8 Add module clean command
- Add new CleanCommand for cleaning up module directories
- Supports cleaning notebooks (*.ipynb) and cache files (__pycache__, *.pyc)
- Can clean specific modules or all modules
- Provides preview of files to be cleaned with confirmation
- Includes --force flag to skip confirmation
- Integrates with module command group as 'tito module clean'
- Preserves Python source files (*_dev.py) and other important files
- Fixes issue with duplicate file removal from __pycache__ directories
2025-07-11 23:48:26 -04:00
Vijay Janapa Reddi
de40de5b11 Remove redundant py_to_notebook tool in favor of Jupytext
- Delete bin/py_to_notebook.py and tito/tools/py_to_notebook.py
- Update notebooks command to use Jupytext directly
- Jupytext is already configured in all *_dev.py files
- Simpler, more standard workflow using established tools
- Better integration with NBDev ecosystem

Benefits:
- Eliminates duplicate conversion tools
- Uses industry-standard Jupytext instead of custom tool
- Reduces maintenance burden
- Better error handling and compatibility
2025-07-11 23:31:55 -04:00
Vijay Janapa Reddi
73b39395eb Remove version field from module metadata
- Remove version field from all module.yaml files
- Update template generator to exclude version field
- Further simplify metadata to focus on system information only
- Status remains dynamically determined by test results
2025-07-11 23:23:10 -04:00
Vijay Janapa Reddi
6879d26577 Simplify module metadata to focus on essential system information
- Reduce module.yaml files from 100+ lines to ~25 lines focused on system needs
- Remove pedagogical details (learning objectives, difficulty, time estimates)
- Keep only essential fields: name, title, description, status, dependencies, exports, files, components
- Update status command to work with simplified metadata format
- Update metadata generation script to create simplified templates
- Focus on system metadata for CLI tools and build systems, not educational content

Before: Verbose pedagogical metadata with 20+ fields
After: Concise system metadata with 8 core fields

This aligns with the principle that module.yaml should be for systems, not pedagogy.
2025-07-11 23:02:10 -04:00
Vijay Janapa Reddi
48e62a954a fix: Use concise module titles instead of verbose ones
- Changed all module titles to be short and clean (e.g., 'Autograd' not 'Autograd - Automatic Differentiation')
- Updated metadata generation template to use concise titles by default
- Fixed CLI reference in metadata generator to use new hierarchical structure
- Titles are now consistent: just the module name capitalized
- Detailed descriptions remain in the description field where they belong
2025-07-11 22:40:30 -04:00
Vijay Janapa Reddi
b92642a96e feat: Add comprehensive module metadata system
- Add module.yaml files for setup, tensor, activations, layers, and autograd modules
- Enhanced tito status command with --metadata flag for rich information display
- Created metadata schema with learning objectives, dependencies, components, and more
- Added metadata generation script (bin/generate_module_metadata.py)
- Comprehensive documentation in docs/development/module-metadata-system.md
- Status command now shows module status, difficulty, time estimates, and detailed metadata
- Supports dependency tracking, component-level status, and educational information
- Enables rich CLI experience with structured module information
2025-07-11 22:33:24 -04:00
Vijay Janapa Reddi
69d65d38c3 feat: Add modules command and clean up CLI duplication
- Add new 'tito modules' command for comprehensive module status checking
  - Scans all modules in modules/ directory automatically
  - Shows file structure (dev file, tests, README)
  - Runs tests with --test flag
  - Provides detailed breakdown with --details flag

- Remove duplicate/stub commands:
  - Remove 'tito status' (unimplemented stub)
  - Remove 'tito submit' (unimplemented stub)

- Update 'tito test' command:
  - Focus on individual module testing with detailed output
  - Redirect 'tito test --all' to 'tito modules --test' with recommendation
  - Better error handling with available modules list

- Add comprehensive documentation:
  - docs/development/testing-separation.md - explains module vs package checking
  - docs/development/command-cleanup-summary.md - documents CLI cleanup

Key benefit: Clear separation between module development status (tito modules)
and TinyTorch package functionality (tito info) with no confusing overlaps.
2025-07-11 22:14:53 -04:00