Skip to content
BIASED

Derivatives and Taylor series

Block 1 of 7~2 min

From secant to tangent

The topic The singular value decomposition closed the linear algebra part. We can now describe a model: it is a map such as the linear layer x↦Wx+bx \mapsto Wx + b. We cannot yet train it. Training changes the parameters θ\theta to lower a loss L(θ)L(\theta), and for that we need to know how the loss reacts to a small change of θ\theta. That is what a derivative measures. This topic works with a single parameter; many parameters come in the next one.

Take two points on the graph of ff, at xx and at x+hx + h. The line through them is a secant. Its slope is the difference quotient

f(x+h)−f(x)h.\frac{f(x + h) - f(x)}{h}.

For f(x)=x2f(x) = x^2 at x=1x = 1 the quotient equals (1+h)2−1h=2+h\frac{(1 + h)^2 - 1}{h} = 2 + h. With h=0.1h = 0.1 it is 2.12.1, with h=0.01h = 0.01 it is 2.012.01. As h→0h \to 0 the secant turns into the tangent, and its slope settles at one number. That limit is the derivative:

f′(x)=lim⁡h→0f(x+h)−f(x)h.f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}.

Here f′(1)=2f'(1) = 2.

The running example of this topic is a model with one weight that predicts y^=θx\hat y = \theta x. On a single example (x,y)=(2,3)(x, y) = (2, 3) its squared error is

L(θ)=(2θ−3)2.L(\theta) = (2\theta - 3)^2.

At θ=1\theta = 1 the loss is L(1)=1L(1) = 1. The sign of L′(θ)L'(\theta) tells us which way to move θ\theta, and its size tells us how strongly the loss responds.

Answers are saved on the server and tied to this browser until you sign in.