Directional derivatives
For a differentiable scalar function, the unit-direction derivative is its gradient dotted with the unit direction vector.
On this page 9 sections
- Overview
- Partial derivatives test the coordinate axes
- For v=(3,4), the length is 5, so u=(0.6,0.8)
- A negative rate means the output locally decreases in that direction
- This calculation evaluates a proposed direction before an optimization step
- Key takeaway
- Further questions
- Sources & further reading
- Concept connections
01Partial derivatives test the coordinate axes#
Partial derivatives test the coordinate axes. A directional derivative asks about moving along another direction, such as changing two weights together. A unit direction makes the answer a rate per unit of distance moved, so directions can be compared fairly.
A direction vector can be long or short. For a rate per unit input distance, first turn a nonzero vector into a unit vector.
For a differentiable scalar function, dot its gradient at the point with the unit direction. The result is a scalar rate.
must have length 1.
With gradient and direction vector , first check the direction has length 1. The rate is . Reversing the direction makes the rate . Using itself without normalizing gives 25, which also includes its fivefold movement speed.
Differentiable : , unit . Find .
Show answer and explanation
.
02For v=(3,4), the length is 5, so u=(0.6,0.8)#
For , the length is 5, so . If , the rate is . Divide the raw dot product 15 by length 5 for the unit-distance rate.
Differentiable : , . Repair the claimed rate 4 per unit distance.
Show answer and explanation
: rate 0.
03A negative rate means the output locally decreases in that direction#
A negative rate means the output locally decreases in that direction. If and , the rate is . A zero vector has no direction to normalize.
Cost . At , use direction . Find the rate per unit distance.
Show answer and explanation
; .
04This calculation evaluates a proposed direction before an optimization step#
This calculation evaluates a proposed direction before an optimization step. A negative rate predicts a decrease for a sufficiently small positive step under differentiability. It does not establish how far to move; the size of the step remains a separate choice.
Normalize the direction, then dot with the gradient.
- Compute a directional rate using a unit direction.
Further questions
Can I use a zero direction vector?
Does doubling a direction double this rate?
Sources & further reading
- [1]