Skip to main content
Interactive 3D/Automatic Differentiation
z = (x + y) · sin(x)∂a/∂x=1∂a/∂y=1∂b/∂x=cos(x)∂z/∂a=sin(x)∂z/∂b=ainputx=2.000inputy=3.000+a=5.000sinb=0.909×z=4.546
Inputs
x = 2.00
-33
y = 3.00
-33
Passes
Values
x: 2.0000
y: 3.0000
a: 5.0000
b: 0.9093
z: 4.5465
Gradients (∂z/∂·)
∂z/∂x: -1.1714
∂z/∂y: 0.9093
∂z/∂a: 0.9093
∂z/∂b: 5.0000
∂z/∂z: 1.0000
Key Idea
Autodiff applies the chain rule on a computation graph. Forward pass stores values. Backward pass multiplies local gradients along each path to get ∂loss/∂param.
Try: Click Forward, then Backward. Watch indigo flow forward and orange flow backward.

Automatic Differentiation - Interactive Visualization

Automatic differentiation is the engine behind every deep learning framework. It builds a computation graph of operations during the forward pass, then applies the chain rule backwards to compute exact gradients. This visualization shows z = (x+y)·sin(x) as a DAG. Click Forward to see values flow left-to-right, then Backward to see gradients flow right-to-left - exactly what PyTorch's autograd does.

  • Step through forward pass: values flow from inputs to output
  • Step through backward pass: gradients flow from output to inputs
  • Adjust x and y sliders to see all values recompute
  • See chain rule applied at each node in the graph
  • Understand exactly what torch.backward() does under the hood

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.