Automatic Differentiation

التفاضل الآلي

Abbreviation: AutoDiff

Definition

A technique that computes the exact derivatives of a computer program automatically by applying the chain rule to its elementary operations.

Definition

Automatic differentiation computes exact derivatives of programs by applying the chain rule to elementary operations; reverse mode underlies backpropagation.

Practical examples

Code example Python
class V:
    def __init__(s, v): s.v, s.g = v, 0.0

x = V(3.0)
y = x.v ** 2          # y = x^2
x.g = 2 * x.v         # dy/dx = 2x
print(y, x.g)

Expected output

9.0 6.0

Learn and review

Suggested terms to learn next