Linear-Form Gradients
A linear form f(x)=a^Tx multiplies each input coordinate by a fixed coefficient and sums.
On this page 7 sections
01Each coefficient is a sensitivity#
A linear form multiplies each input coordinate by a fixed coefficient and sums. Its gradient records how that scalar changes when each input coordinate changes independently.
For , the function is . Differentiating with respect to gives ; differentiating with respect to gives .
02The gradient is not the value#
At , the function value is . Its gradient is still . The value depends on the input; this gradient does not, because the coefficients are constant.
The column gradient has the same shape as the column input . The expression is a scalar even though its gradient has several entries.
Find the column gradient of f(x)=4x₁−2x₂.
Show answer and explanation
Each coordinate derivative is its fixed coefficient.
03Read a weighted score#
For a supplied score , the gradient with respect to the weights is . Here the feature values are the fixed coefficients. Variable names do not change the rule; the chosen differentiation variable does matter.
A constant offset adds no derivative. For , the gradient is unchanged. This follows from the constant derivative rule.
A draft uses ∇ₓ(aᵀx)=a when a=x, for f=xᵀx. What assumption failed?
Show answer and explanation
Both copies of x vary, so there are additional derivative contributions.
The coefficient vector must be constant with respect to the variable. If it also depends on that variable, its derivative contributes additional terms. Checking what is held fixed is part of applying the rule correctly.
Compute the gradient of aᵀx with respect to x for a constant real vector a.
- Compute the gradient of aᵀx with respect to x for a constant real vector a.
Sources & further reading
- [1]MIT 6.390, Appendix A: Matrix Calculus ↗introml.mit.edu · Article
- [2]Boyd and Vandenberghe, Introduction to Applied Linear Algebra ↗stanford.edu · Article