liveBook · Manning

Derivative

As explained in Deep Learning with Python, Third Edition

The mathematical process of computing derivatives, used here to support gradient-based learning.

A derivative measures the local slope of a function: how strongly its output changes when its input changes slightly. A positive derivative signals increase, a negative derivative signals decrease, and its magnitude measures the rate of change. section 2.4.1

From a small input change to optimization

Near a point p, a smooth function can be approximated by f(x + εx) = y + a · εx, where a is the derivative at p. To reduce f(x), adjust x slightly opposite the derivative’s direction. Familiar rules include d(cos x)/dx = −sin x and d(ax)/dx = a. section 2.4.1

Differentiation extends from scalar functions to tensor operations. The resulting gradient has the same shape as the input tensor and records how each input component changes the output, such as a loss value. section 2.4.2

For gradient-based learning, follow this practical chain:

  • Use x and model weights W to compute predictions, then compare them with y_true through a loss function. section 2.4.2
  • Interpret grad(loss_value, W0) as the direction and magnitude of loss change for each weight at the current W0. section 2.4.2
  • Move weights in the direction that lowers the loss; this supplies the intuition behind gradient descent and neural-network learning. section 2.4.1 section 2.0
f(x + epsilon_x) = y + a * epsilon_x

Inspect the local linear approximation that connects a small input change with the derivative. section 2.4.1

y_pred = matmul(x, W)                                               #1
loss_value = loss(y_pred, y_true)                                   #2

Trace the concrete prediction-to-loss computation that turns model weights into an optimization target. section 2.4.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Defines local slope, linear approximation, and tensor gradients, while staying intuitive and avoiding heavy notation or derivations.
Examples
Uses cosine and linear functions, local slope diagrams, and a weight-to-loss computation involving predictions and targets.
What it assumes
Introduces the intuition from basic functions and small changes, without assuming a deep mathematics background.
What you can do after
Evaluate/understand how derivatives and gradients guide parameter updates for minimizing loss.
How it connects
Connects continuity, smoothness, tensors, loss functions, optimization, gradient descent, and backpropagation.

Also explained in

Compare how 6 books explain derivative →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.