mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-06-02 03:00:52 -05:00
PROBLEM: - nbdev requires #| export directive on EACH cell to export when using # %% markers - Cell markers inside class definitions split classes across multiple cells - Only partial classes were being exported to tinytorch package - Missing matmul, arithmetic operations, and activation classes in exports SOLUTION: 1. Removed # %% cell markers INSIDE class definitions (kept classes as single units) 2. Added #| export to imports cell at top of each module 3. Added #| export before each exportable class definition in all 20 modules 4. Added __call__ method to Sigmoid for functional usage 5. Fixed numpy import (moved to module level from __init__) MODULES FIXED: - 01_tensor: Tensor class with all operations (matmul, arithmetic, shape ops) - 02_activations: Sigmoid, ReLU, Tanh, GELU, Softmax classes - 03_layers: Linear, Dropout classes - 04_losses: MSELoss, CrossEntropyLoss, BinaryCrossEntropyLoss classes - 05_autograd: Function, AddBackward, MulBackward, MatmulBackward, SumBackward - 06_optimizers: Optimizer, SGD, Adam, AdamW classes - 07_training: CosineSchedule, Trainer classes - 08_dataloader: Dataset, TensorDataset, DataLoader classes - 09_spatial: Conv2d, MaxPool2d, AvgPool2d, SimpleCNN classes - 10-20: All exportable classes in remaining modules TESTING: - Test functions use 'if __name__ == "__main__"' guards - Tests run in notebooks but NOT on import - Rosenblatt Perceptron milestone working perfectly RESULT: ✅ All 20 modules export correctly ✅ Perceptron (1957) milestone functional ✅ Clean separation: development (modules/source) vs package (tinytorch)
110 lines
12 KiB
Python
Generated
110 lines
12 KiB
Python
Generated
# ╔═══════════════════════════════════════════════════════════════════════════════╗
|
|
# ║ 🚨 CRITICAL WARNING 🚨 ║
|
|
# ║ AUTOGENERATED! DO NOT EDIT! ║
|
|
# ║ ║
|
|
# ║ This file is AUTOMATICALLY GENERATED from source modules. ║
|
|
# ║ ANY CHANGES MADE HERE WILL BE LOST when modules are re-exported! ║
|
|
# ║ ║
|
|
# ║ ✅ TO EDIT: modules/source/[unknown]/[unknown]_dev.py ║
|
|
# ║ ✅ TO EXPORT: Run 'tito module complete <module_name>' ║
|
|
# ║ ║
|
|
# ║ 🛡️ STUDENT PROTECTION: This file contains optimized implementations. ║
|
|
# ║ Editing it directly may break module functionality and training. ║
|
|
# ║ ║
|
|
# ║ 🎓 LEARNING TIP: Work in modules/source/ - that's where real development ║
|
|
# ║ happens! The tinytorch/ directory is just the compiled output. ║
|
|
# ╚═══════════════════════════════════════════════════════════════════════════════╝
|
|
# Autogenerated by nbdev
|
|
|
|
d = { 'settings': { 'branch': 'main',
|
|
'doc_baseurl': '/TinyTorch/',
|
|
'doc_host': 'https://tinytorch.github.io',
|
|
'git_url': 'https://github.com/tinytorch/TinyTorch/',
|
|
'lib_path': 'tinytorch'},
|
|
'syms': { 'tinytorch.benchmarking.benchmark': {},
|
|
'tinytorch.core.activations': { 'tinytorch.core.activations.GELU': ( '02_activations/activations_dev.html#gelu',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.GELU.backward': ( '02_activations/activations_dev.html#gelu.backward',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.GELU.forward': ( '02_activations/activations_dev.html#gelu.forward',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.ReLU': ( '02_activations/activations_dev.html#relu',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.ReLU.backward': ( '02_activations/activations_dev.html#relu.backward',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.ReLU.forward': ( '02_activations/activations_dev.html#relu.forward',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Sigmoid': ( '02_activations/activations_dev.html#sigmoid',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Sigmoid.__call__': ( '02_activations/activations_dev.html#sigmoid.__call__',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Sigmoid.backward': ( '02_activations/activations_dev.html#sigmoid.backward',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Sigmoid.forward': ( '02_activations/activations_dev.html#sigmoid.forward',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Softmax': ( '02_activations/activations_dev.html#softmax',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Softmax.backward': ( '02_activations/activations_dev.html#softmax.backward',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Softmax.forward': ( '02_activations/activations_dev.html#softmax.forward',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Tanh': ( '02_activations/activations_dev.html#tanh',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Tanh.backward': ( '02_activations/activations_dev.html#tanh.backward',
|
|
'tinytorch/core/activations.py'),
|
|
'tinytorch.core.activations.Tanh.forward': ( '02_activations/activations_dev.html#tanh.forward',
|
|
'tinytorch/core/activations.py')},
|
|
'tinytorch.core.layers': { 'tinytorch.core.layers.Dropout': ('03_layers/layers_dev.html#dropout', 'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Dropout.__init__': ( '03_layers/layers_dev.html#dropout.__init__',
|
|
'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Dropout.__repr__': ( '03_layers/layers_dev.html#dropout.__repr__',
|
|
'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Dropout.forward': ( '03_layers/layers_dev.html#dropout.forward',
|
|
'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Dropout.parameters': ( '03_layers/layers_dev.html#dropout.parameters',
|
|
'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Linear': ('03_layers/layers_dev.html#linear', 'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Linear.__call__': ( '03_layers/layers_dev.html#linear.__call__',
|
|
'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Linear.__init__': ( '03_layers/layers_dev.html#linear.__init__',
|
|
'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Linear.__repr__': ( '03_layers/layers_dev.html#linear.__repr__',
|
|
'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Linear.forward': ( '03_layers/layers_dev.html#linear.forward',
|
|
'tinytorch/core/layers.py'),
|
|
'tinytorch.core.layers.Linear.parameters': ( '03_layers/layers_dev.html#linear.parameters',
|
|
'tinytorch/core/layers.py')},
|
|
'tinytorch.core.tensor': { 'tinytorch.core.tensor.Tensor': ('01_tensor/tensor_dev.html#tensor', 'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.__add__': ( '01_tensor/tensor_dev.html#tensor.__add__',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.__init__': ( '01_tensor/tensor_dev.html#tensor.__init__',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.__mul__': ( '01_tensor/tensor_dev.html#tensor.__mul__',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.__repr__': ( '01_tensor/tensor_dev.html#tensor.__repr__',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.__str__': ( '01_tensor/tensor_dev.html#tensor.__str__',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.__sub__': ( '01_tensor/tensor_dev.html#tensor.__sub__',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.__truediv__': ( '01_tensor/tensor_dev.html#tensor.__truediv__',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.backward': ( '01_tensor/tensor_dev.html#tensor.backward',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.matmul': ( '01_tensor/tensor_dev.html#tensor.matmul',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.max': ( '01_tensor/tensor_dev.html#tensor.max',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.mean': ( '01_tensor/tensor_dev.html#tensor.mean',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.numpy': ( '01_tensor/tensor_dev.html#tensor.numpy',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.reshape': ( '01_tensor/tensor_dev.html#tensor.reshape',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.sum': ( '01_tensor/tensor_dev.html#tensor.sum',
|
|
'tinytorch/core/tensor.py'),
|
|
'tinytorch.core.tensor.Tensor.transpose': ( '01_tensor/tensor_dev.html#tensor.transpose',
|
|
'tinytorch/core/tensor.py')},
|
|
'tinytorch.data.loader': {},
|
|
'tinytorch.profiling.profiler': {}}}
|