Compare manual and automatic gradients
Compare hand calculations with automatic ones so you can catch a broken rule for changing the model.
- Starting information
One variable used twice: x × x
- Relationship or operation
Both input edges contribute x
- Consequence
Derivative: x + x = 2x
Automatic differentiation follows an operation graph. Shared uses must accumulate contributions; overwriting one contribution produces a wrong gradient.
Your learning goal
Trace reverse-mode accumulation through shared inputs, verify batch shapes and mean scaling, and apply simultaneous parameter updates.