STANDARDIZE: Consistent Linear terminology across all modules

Remove backward compatibility aliases and enforce PyTorch-consistent naming:
- Remove Dense = Linear alias in Module 04 (layers)
- Update all Dense references to Linear in Modules 02, 08, 09, 18, 21
- Remove MaxPool2d = MaxPool2D alias in Module 17 (quantization)
- Standardize fc/dense_weights to linear_weights in Module 18 (compression)

Benefits:
- Eliminates naming confusion between Dense/Linear terminology
- Aligns with PyTorch production patterns (nn.Linear)
- Reduces cognitive load with single consistent naming convention
- Improves student transfer to real ML frameworks

All modules tested and functionality preserved.
This commit is contained in:
Vijay Janapa Reddi
2025-09-26 11:51:54 -04:00
parent 88266097fb
commit f8fd2e000c
7 changed files with 102 additions and 102 deletions

View File

@@ -63,7 +63,6 @@ from typing import Union, List, Optional, Tuple, Dict, Any
try:
from tinytorch.core.tensor import Tensor
from tinytorch.core.spatial import Conv2d, MaxPool2D
MaxPool2d = MaxPool2D # Alias for consistent naming
except ImportError:
# For development, import from local modules
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '02_tensor'))
@@ -71,7 +70,6 @@ except ImportError:
try:
from tensor_dev import Tensor
from spatial_dev import Conv2d, MaxPool2D
MaxPool2d = MaxPool2D # Alias for consistent naming
except ImportError:
# Create minimal mock classes if not available
class Tensor: