feat: Add consistent 'Where This Code Lives' template across modules

- Add template section to tensor, layers, activations, and cnn modules
- Create docs/development/module-template.md for future reference
- Clarify learning vs building structure consistently
- Show students where their code will live in the final package
- Decouple learning modules from production organization
This commit is contained in:
Vijay Janapa Reddi
2025-07-10 23:48:49 -04:00
parent 38cac60aff
commit eebb22ebdb
5 changed files with 130 additions and 10 deletions
+18 -5
View File
@@ -30,13 +30,26 @@ Welcome to the Layers module! This is where neural networks begin. You'll implem
This module builds on the **activations** module:
- **activations** → **layers** → **networks**
- Clean separation of concerns: math functions → layer building blocks → full networks
"""
## Module → Package Structure
**🎓 Teaching vs. 🔧 Building**:
- **Learning side**: Work in `modules/layers/layers_dev.py`
- **Building side**: Exports to `tinytorch/core/layers.py`
# %% [markdown]
"""
## 📦 Where This Code Lives in the Final Package
This module builds the fundamental transformations that compose into neural networks.
**Learning Side:** You work in `modules/layers/layers_dev.py`
**Building Side:** Code exports to `tinytorch.core.layers`
```python
# Final package structure:
from tinytorch.core.layers import Dense, Conv2D # All layers together!
from tinytorch.core.activations import ReLU, Sigmoid, Tanh
from tinytorch.core.tensor import Tensor
```
**Why this matters:**
- **Learning:** Focused modules for deep understanding
- **Production:** Proper organization like PyTorch's `torch.nn`
- **Consistency:** All layers (Dense, Conv2D) live together in `core.layers`
"""
# %%