Commit Graph

25 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
0c24d77a86 Fix module structure ordering across all modules
Standardize module structure to ensure correct section ordering:
- if __name__ block → ML Systems Thinking → Module Summary (always last)

Fixed 10 modules with incorrect ordering:
• 02_tensor, 04_layers, 05_dense, 06_spatial
• 08_dataloader, 09_autograd, 10_optimizers, 11_training
• 12_compression (consolidated 3 scattered if blocks)
• 15_mlops (consolidated 6 scattered if blocks)

All 17 modules now follow consistent structure:
1. Content and implementations
2. Main execution block (if __name__)
3. ML Systems Thinking Questions
4. Module Summary (always last section)

Updated CLAUDE.md with explicit ordering requirements to prevent future issues.
2025-09-17 17:33:09 -04:00
Vijay Janapa Reddi
d04d66a716 Implement interactive ML Systems questions and standardize module structure
Major Educational Framework Enhancements:
• Deploy interactive NBGrader text response questions across ALL modules
• Replace passive question lists with active 150-300 word student responses
• Enable comprehensive ML Systems learning assessment and grading

TinyGPT Integration (Module 16):
• Complete TinyGPT implementation showing 70% component reuse from TinyTorch
• Demonstrates vision-to-language framework generalization principles
• Full transformer architecture with attention, tokenization, and generation
• Shakespeare demo showing autoregressive text generation capabilities

Module Structure Standardization:
• Fix section ordering across all modules: Tests → Questions → Summary
• Ensure Module Summary is always the final section for consistency
• Standardize comprehensive testing patterns before educational content

Interactive Question Implementation:
• 3 focused questions per module replacing 10-15 passive questions
• NBGrader integration with manual grading workflow for text responses
• Questions target ML Systems thinking: scaling, deployment, optimization
• Cumulative knowledge building across the 16-module progression

Technical Infrastructure:
• TPM agent for coordinated multi-agent development workflows
• Enhanced documentation with pedagogical design principles
• Updated book structure to include TinyGPT as capstone demonstration
• Comprehensive QA validation of all module structures

Framework Design Insights:
• Mathematical unity: Dense layers power both vision and language models
• Attention as key innovation for sequential relationship modeling
• Production-ready patterns: training loops, optimization, evaluation
• System-level thinking: memory, performance, scaling considerations

Educational Impact:
• Transform passive learning to active engagement through written responses
• Enable instructors to assess deep ML Systems understanding
• Provide clear progression from foundations to complete language models
• Demonstrate real-world framework design principles and trade-offs
2025-09-17 14:42:24 -04:00
Vijay Janapa Reddi
719507bb8f Standardize NBGrader formatting and fix test execution patterns across all modules
This comprehensive update ensures all TinyTorch modules follow consistent NBGrader
formatting guidelines and proper Python module structure:

- Fix test execution patterns: All test calls now wrapped in if __name__ == "__main__" blocks
- Add ML Systems Thinking Questions to modules missing them
- Standardize NBGrader formatting (BEGIN/END SOLUTION blocks, STEP-BY-STEP, etc.)
- Remove unused imports across all modules
- Fix syntax errors (apostrophes, special characters)
- Ensure modules can be imported without running tests

Affected modules: All 17 development modules (00-16)
Agent workflow: Module Developer → QA Agent → Package Manager coordination
Testing: Comprehensive QA validation completed
2025-09-16 19:48:54 -04:00
Vijay Janapa Reddi
6349c218d2 Standardize all modules to follow NBGrader style guide
- Updated 7 non-compliant modules for consistency
- Module 01_setup: Added EXAMPLE USAGE sections with code examples
- Module 02_tensor: Added STEP-BY-STEP IMPLEMENTATION and LEARNING CONNECTIONS
- Module 05_dense: Added LEARNING CONNECTIONS to all functions
- Module 06_spatial: Added STEP-BY-STEP and LEARNING CONNECTIONS
- Module 08_dataloader: Added LEARNING CONNECTIONS sections
- Module 11_training: Added STEP-BY-STEP and LEARNING CONNECTIONS
- Module 14_benchmarking: Added STEP-BY-STEP and LEARNING CONNECTIONS
- All modules now follow consistent format per NBGRADER_STYLE_GUIDE.md
- Preserved all existing solution blocks and functionality
2025-09-16 16:48:14 -04:00
Vijay Janapa Reddi
2e5bbcce3c Simplify module structure and remove confusing 5 C's framework
- Clean up CLAUDE.md module structure from 10+ parts to 8 logical sections
- Remove confusing 'Concept, Context, Connections' framework references
- Simplify to clear flow: Introduction → Background → Implementation → Testing → Integration
- Keep Build→Use→Understand compliance for Education Architect
- Remove thinking face emoji from ML Systems Thinking section
- Focus on substance over artificial framework constraints
2025-09-15 20:12:36 -04:00
Vijay Janapa Reddi
e2cf68e2d8 Enhance module structure with ML systems thinking questions and clean organization
- Add ML systems thinking reflection questions to Module 02 tensor
- Consolidate all development standards into CLAUDE.md as single source of truth
- Remove 7 unnecessary template .md files to prevent confusion
- Restore educational markdown explanations before all unit tests
- Establish Documentation Publisher agent responsibility for thoughtful reflection questions
- Update module standards to require immediate testing pattern and ML systems reflection
2025-09-15 20:12:04 -04:00
Vijay Janapa Reddi
be6ac663b9 Fix markdown format issues and prevent agent overlap
CRITICAL FIX:
- Fixed tensor_dev.py markdown cells from comments to triple quotes
- All markdown content now visible in notebooks again
- Added CRITICAL markdown format rule to template

WORKFLOW IMPROVEMENTS:
- Added AGENT_WORKFLOW_RESPONSIBILITIES.md with clear lane division
- Each agent is expert in their domain only
- No overlap: Education Architect ≠ Documentation Publisher ≠ Module Developer

Agent responsibilities:
- Education Architect: learning strategy only
- Module Developer: code implementation only
- Quality Assurance: testing validation only
- Documentation Publisher: writing polish only
2025-09-15 19:43:27 -04:00
Vijay Janapa Reddi
357b8cd5bb Revert "Restructure Module 02 (Tensor) with unified template"
This reverts commit 12da3d9f99762d789e6416ac736331fac98ab8d0.
2025-09-15 18:39:29 -04:00
Vijay Janapa Reddi
f8632b6021 Restructure Module 02 (Tensor) with unified template
- Add 5 C's framework for systematic concept understanding
- Separate implementation from testing for clearer learning flow
- Consolidate 15+ fragmented markdown cells into 4 focused sections
- Create clean progression: Concept → Implementation → Test → Usage
- Establish model structure for other modules to follow
2025-09-15 18:17:27 -04:00
Vijay Janapa Reddi
af9f01b22e Restore complete 5 C's content with improved format and codify standard
Module 02 Updates:
- Restore full 5 C's educational content (CONCEPT, CODE STRUCTURE, CONNECTIONS, CONSTRAINTS, CONTEXT)
- Use integrated code-comment format for natural flow
- Maintain all essential educational information
- Clear section header: 'Before We Code: The 5 C's'

New Format Standard:
- Create FIVE_CS_FORMAT_STANDARD.md to codify the approach
- Define exact structure for all future modules
- Include complete example with tensor implementation
- Specify when and how to use the format

The 5 C's content is excellent - this improves the presentation
format while preserving all educational value. Students get
complete context before implementation in a natural, scannable format.
2025-09-15 14:48:06 -04:00
Vijay Janapa Reddi
6eb1c5d3e9 Improve 5 C's format: Use integrated code-comment style
Replace verbose bullet format with code-comment approach that:
- Integrates concepts directly with implementation preview
- Shows exactly where each principle applies in actual code
- Feels more natural and less academic
- Maintains educational value while respecting student time
- Bridges gap between understanding and coding

The code-comment style helps students see the connection between
concepts and implementation rather than treating them as separate
academic content.
2025-09-15 14:38:14 -04:00
Vijay Janapa Reddi
3c21f25562 Add 5 C's pattern to Module 02 (Tensor) implementation
- Add comprehensive 5 C's educational framework before Tensor class
- Explain CONCEPT: What tensors are in ML context
- Detail CODE STRUCTURE: What we're building
- Show CONNECTIONS: PyTorch/TensorFlow/NumPy relationships
- Define CONSTRAINTS: Implementation requirements
- Provide CONTEXT: Why tensors matter in ML systems

This completes the educational scaffolding for Module 02, ensuring
students understand WHY they're building tensors before HOW to
implement them.
2025-09-15 14:27:11 -04:00
Vijay Janapa Reddi
af372cf412 Improve Modules 01 and 02 to meet TinyTorch educational standards
Module 01 (Setup) Improvements:
- Fix duplicate grade_id (changed to setup-verification)
- Add comprehensive 5 C's pattern before implementations
- Replace hardcoded instructor data with generic placeholders
- Implement test-immediately pattern after each function
- Add proper NBGrader metadata to all test cells

Module 02 (Tensor) Improvements:
- Move ALL scaffolding outside BEGIN/END SOLUTION blocks
- Add complete 5 C's pattern before Tensor implementation
- Fix test naming to consistent test_unit_* pattern
- Ensure tests run immediately after implementations
- Maintain proper NBGrader metadata with unique grade_ids

Key Standards Applied:
- 5 C's Pattern: Concept, Code Structure, Connections, Constraints, Context
- Test-immediately: Every implementation followed by immediate validation
- NBGrader Ready: Scaffolding outside solutions for student releases
- Professional Standards: Generic data and consistent patterns

These improvements ensure both modules:
1. Pass NBGrader validation for student releases
2. Provide comprehensive educational scaffolding
3. Follow test-immediately pattern for rapid feedback
4. Meet all TinyTorch quality standards
2025-09-15 14:25:49 -04:00
Vijay Janapa Reddi
bbf1dd91c9 Add integration test to 02_tensor module: test_module_tensor_numpy_integration
- Tests tensor integration with NumPy arrays and operations
- Validates tensor-NumPy compatibility for scientific computing
- Ensures broadcasting works correctly between tensors and scalars
- Verifies integration with NumPy functions on tensor data
- Positioned before MODULE SUMMARY as per educational structure
2025-07-20 13:57:34 -04:00
Vijay Janapa Reddi
cc9cdee97d Deprecate AUTO TESTING: Remove run_module_tests_auto from all _dev.py modules. Standardize on full-module test execution for reliable, context-aware testing. 2025-07-20 13:28:10 -04:00
Vijay Janapa Reddi
98a7228bf5 Removes development headers from notebooks
Removes redundant "DEVELOPMENT" headers from several notebook files.

These headers are no longer necessary and declutter the notebook content, improving readability and focus on the core content and testing sections.
2025-07-20 12:39:21 -04:00
Vijay Janapa Reddi
51af9dd5d7 Standardize section headers for 02_tensor module 2025-07-20 12:24:40 -04:00
Vijay Janapa Reddi
c4d987cbb7 docs: Add comprehensive test documentation across all modules
 Standardized test explanations with consistent format
📝 Added markdown cells before all test functions
🎯 Improved educational clarity for student understanding

Changes:
- 01_setup: Added 2 test explanations (personal_info, system_info)
- 02_tensor: Added 3 test explanations (creation, properties, arithmetic)
- 12_compression: Added 8 test explanations (metrics, pruning, quantization, distillation, etc.)

All 15 modules now follow standardized test documentation pattern:
### 🧪 Unit Test: [Component Name]
[Brief explanation of validation purpose]

Ensures every test has clear educational context for students.
2025-07-20 10:58:08 -04:00
Vijay Janapa Reddi
c0b27e7b61 🧪 Add missing test function calls in 02_tensor module
- Added test_unit_tensor_creation() call after function definition
- Added test_unit_tensor_properties() call after function definition
- Added test_unit_tensor_arithmetic() call after function definition

Ensures test functions are actually executed when cells run, providing immediate feedback to students.
2025-07-20 10:19:56 -04:00
Vijay Janapa Reddi
c2a12fe7dd Add structural organization headers to 02_tensor module
- Added ## 🔧 DEVELOPMENT section before Step 1 where development begins
- Added ## 🤖 AUTO TESTING section before nbgrader block
- Updated to ## 🎯 MODULE SUMMARY: Tensor Foundation

Improves notebook organization without changing any code logic or content.
2025-07-20 09:54:46 -04:00
Vijay Janapa Reddi
6922b7eb31 Fix 02_tensor: Correct pattern - Tests → STANDARDIZED MODULE TESTING → Module Summary
CORRECT PATTERN NOW:
1.  Unit tests (test_unit_tensor_creation, test_unit_tensor_properties, test_unit_tensor_arithmetic)
2.  ## 🧪 Module Testing
3.  STANDARDIZED MODULE TESTING cell
4.  run_module_tests_auto call
5.  ## 🎯 Module Summary (immediately after, no code between)

 Moved test functions from after run_module_tests_auto to before ## 🧪 Module Testing
 Removed duplicate test functions from wrong location
 Clean separation: Tests → Testing → Summary
 No code between STANDARDIZED MODULE TESTING and Module Summary
2025-07-20 09:25:38 -04:00
Vijay Janapa Reddi
39ec4a725d Fix 02_tensor: Move test code to correct location
Module 02_tensor now follows the correct pattern learned from layers_dev:
1. ## 🧪 Module Testing (explanation)
2. Standardized testing cell with run_module_tests_auto
3. Actual test functions (test_unit_tensor_creation, test_unit_tensor_properties, test_unit_tensor_arithmetic)
4. ## 🎯 Module Summary

 Moved test functions from end of file to proper location after standardized testing
 Removed duplicate test functions
 Students now see actual test implementations before the summary
 run_module_tests_auto will auto-discover and run all tests
2025-07-20 09:07:32 -04:00
Vijay Janapa Reddi
48f7b2dea7 🧪 Add standardized module testing to all modules
Ensures consistent testing framework across all TinyTorch modules with:

 Added standardized testing sections to modules that were missing them:
- 01_setup: Added complete testing section + module summary
- 02_tensor: Added testing section + comprehensive module summary
- 15_mlops: Standardized existing testing section to match convention

 All modules now follow the consistent pattern:
1. ## 🧪 Module Testing (markdown explanation)
2. Locked nbgrader cell with standardized-testing ID
3. run_module_tests_auto call to discover and run all tests
4. ## 🎯 Module Summary (educational wrap-up)

 Benefits:
- Consistent testing experience across all 16 modules
- Automatic test discovery and execution before module completion
- Standardized educational flow: learn → implement → test → reflect
- Professional testing practices with locked testing framework

 Verification: All 16 modules now have both:
- '## 🧪 Module Testing' section ✓
- 'run_module_tests_auto' call ✓

This ensures students always verify their implementations work correctly
before moving to the next module, following TinyTorch's educational philosophy.
2025-07-20 09:00:17 -04:00
Vijay Janapa Reddi
82e18761fe Foundation: Standardize test naming in setup and tensor modules
- Rename test functions to follow test_unit_<name> convention
- Setup module: test_personal_info → test_unit_personal_info_basic
- Setup module: test_system_info → test_unit_system_info_basic
- Tensor module: test_tensor_* → test_unit_tensor_*
- Establishes consistent unit test naming for core foundation modules
2025-07-20 08:38:46 -04:00
Vijay Janapa Reddi
d82c75f9dc Renumber modules from 00-13 to 01-14 for natural numbering
 Rename all module directories: 00_setup → 01_setup, etc.
 Update convert_modules.py mappings for new directory names
 Update _toc.yml file paths and titles (1-14 instead of 0-13)
 Regenerate all overview pages with new numbering
 Fix all broken references in usage-paths and intro
 Update chapter references to use natural numbering

Benefits:
- More intuitive course progression starting from 1
- Matches academic course numbering conventions
- Eliminates confusion about 'Module 0' concept
- Cleaner mental model for students and instructors
- All references and links properly updated

Complete transformation: 14 modules now numbered 01-14
2025-07-15 18:51:36 -04:00