Assuming that $f: R^n \rightarrow R$, $a \in R^n$, $g: R\rightarrow R$, and $h: R^n \rightarrow R$
What are the expressions for
- $\nabla f(x) $ and $\nabla^2 f(x)$ where $f(x) = g(h(x))$
and
- $\nabla f(x) $ and $\nabla^2 f(x) $ where $f(x) = g(a^T x)$
Assuming that $f: R^n \rightarrow R$, $a \in R^n$, $g: R\rightarrow R$, and $h: R^n \rightarrow R$
What are the expressions for
and
Copyright © 2021 JogjaFile Inc.
Assuming everything is smooth, the first question is just an application of the so-called chain-rule: $$\nabla_xf=g'(h(x))\nabla_xh.$$ Using the product rule and once more the chain rule, one gets: $${\nabla^2}_xf=g''(h(x)){}^\intercal\nabla_{x}h\times\nabla_xh+g'(h(x)){\nabla^2}_xh.$$
The second question is just an application of the first one with $h\colon x\mapsto {}^\intercal ax$ which is linear.