- Restore Conv2dBackward class removed in commit 23c5eb2b5
- Restore MaxPool2dBackward class for pooling gradient routing
- Update Conv2d/MaxPool2d forward() to attach _grad_fn
- Set requires_grad=True on Conv2d weights and bias
- Add enable_autograd() to Module 11 (Embeddings) for progressive disclosure
- Remove skip markers from convolution gradient tests
CNN training now works correctly - conv weights receive gradients and update
during training. All 40 convolution tests pass.
Conv2d and MaxPool2d use raw numpy operations internally rather than
Tensor operations, so they don't participate in the autograd computation
graph. The forward pass works correctly and requires_grad propagates,
but backward() doesn't compute gradients through these operations.
This is a known architectural limitation of the educational implementation.
Proper autograd support would require either:
1. Rewriting conv/pool to use Tensor ops throughout, OR
2. Manually implementing backward functions
Skip these tests with clear documentation of why.
The progressive disclosure design means layer parameters have
requires_grad=False until an optimizer is created. The optimizer
__init__ sets requires_grad=True on all parameters it receives.
Tests were checking gradient flow without creating an optimizer,
which does not reflect real usage. Students always create an optimizer
before training. Fixed tests to create optimizers first.
Remaining failures are real autograd limitations:
- Conv2d backward does not compute weight gradients
- Embedding backward does not compute weight gradients
- LayerNorm backward does not compute weight gradients
These are honest test failures that expose real bugs.
- Move imports to module level in all *_core.py test files (16 files)
- Remove try/except/skip patterns from integration tests
- Remove @pytest.mark.skip decorators from gradient flow tests
- Convert environment validation skips to warnings for optional checks
- Change milestone tests from skip to fail when scripts missing
Tests now either pass or fail - no silent skipping that hides issues.
This ensures the test suite provides accurate feedback about what works.