liveBook · Manning

Derivative

As explained in Deep Learning with R, Third Edition

A derivative is a measure of how a function's output changes in response to an infinitesimal change in an input.

A derivative measures how a function’s output changes when its input changes infinitesimally. Near a point, it approximates a smooth function with a line whose slope gives the derivative: positive values indicate increase, negative values indicate decrease, and magnitude indicates rate. section 2.4.1

From derivatives to model updates

For a scalar function, the derivative points toward how the output changes. In a neural network, model weights W produce predictions and a loss value. The gradient of that loss with respect to W shows how each weight affects the loss, so updating W in the opposite direction reduces the loss. section 2.4.2 section 2.4.3

Derivatives support optimization through this progression:

  • Treat the loss as a function of the model’s parameters. section 2.4.2
  • Compute its gradient during the backward pass. section 2.4.3
  • Move parameters opposite the gradient, scaled by the learning rate. section 2.4.3
f(x + epsilon_x) = y + a * epsilon_x

The local approximation f(x + epsilon_x) = y + a * epsilon_x makes the derivative’s slope interpretation explicit. section 2.4.1

How Deep Learning with R, Third Edition covers it

How deep it goes
Defines local slope, extends derivatives to tensor-valued functions as gradients, and applies them procedurally in mini-batch optimization.
Examples
Uses cosine, linear functions, model-weight loss, forward and backward passes, and random mini-batches as examples.
What it assumes
Builds from scalar functions and smoothness before extending the idea to tensors and model parameters.
What you can do after
Apply it via gradient descent to choose parameter updates that reduce a neural network’s loss.
How it connects
Connects derivatives with continuity, local linear approximation, gradients, loss functions, optimization, and stochastic gradient descent.

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 R, Third Edition. The section links point to the parts of the book it draws on.