Skip to content
C.W.K.
Stream
Lesson 01 of 05 · published

Calculus's Only Trick: It's About Change

~8 min · calculus, change, derivative

Level 0Math Novice
0 XP0/59 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete

Local Change and Accumulated Change

Knowing how far a car traveled does not immediately tell you its speed now; you need the rate of change of position. Conversely, knowing its speed over time lets you accumulate distance. Differentiation and integration connect those questions.

  • Differentiation measures how sensitively an output changes when an input changes locally.
  • Integration accumulates a rate or density over an interval.

In learning, describes how the loss changes when parameter moves slightly. Collecting these partial derivatives produces a gradient vector that an optimizer can use.

What Automatic Differentiation Does—and Does Not Do

Frameworks such as PyTorch record a computation graph and apply the chain rule, avoiding long symbolic derivations by hand. They do not decide whether the objective is appropriate, whether a nondifferentiable operation broke the graph, or whether the resulting gradient is a useful learning signal.

You still need to reason about sign and scale. If loss rises instead of falling, inspect the update sign; if gradients are zero, inspect saturation, dead activations, detachment, and graph structure.

Differentiation measures local change; integration accumulates over a region. Autograd performs derivative bookkeeping, while people remain responsible for the model and objective.

Code

No hand calculation needed·python
import torch

# Autograd computes derivatives automatically
x = torch.tensor(3.0, requires_grad=True)
y = x ** 2 + 2 * x + 1            # y = (x + 1)^2

y.backward()
print(f"dy/dx at x=3: {x.grad.item()}")    # 8.0 (= 2x + 2 evaluated at x=3)

External links

Exercise

Use PyTorch autograd to find the derivative of y = x^3 - 2x at x = 2. Confirm by hand: dy/dx = 3x^2 - 2, so at x=2 it's 10.
Hint
x = torch.tensor(2.0, requires_grad=True); y = x**3 - 2*x; y.backward(); print(x.grad). Should print 10.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.