沿着梯度的方向为什么是函数值增加最快的方向?

以二元函数为例,$f(x,y)$,对于任意单位方向$u$,假设$u$是$x$轴的夹角,那么函数$f(x,y)$在$u$这个方向上的变化率为:

 $f_x(x,y) \cos \alpha + f_y(x,y) \sin \alpha=\nabla f(x,y)^T\begin{pmatrix}f_x(x,y) \\ f_y(x,y)\end{pmatrix}=\nabla f(x,y)^Tu$也就是两个向量的点积

具体推导:

假设$\nabla f(x,y)$和$u$的夹角为$\theta$,那么函数$f(x,y)$在$u$这个方向上的变化率可以写成:

$\nabla f(x,y)^Tu=\|\nabla f(x,y)\|_2 \|u\|_2 \cos \theta=\|\nabla f(x,y)\|_2\cos \theta$

$cos\theta$的取值范围为[-1,1],当$cos\theta=1$时,函数变化率最大(上升最快),此时$u$是梯度$\nabla f(x,y)$的反方向。

推广到n元函数,函数$f$在单位方向$u$的变化率为$\nabla f^T u$,假设$\nabla f(x,y)$和$u$的夹角为$\theta$,同样函数$f$在$u$这个方向上的变化率可以写成$\nabla f^Tu=\|\nabla f\|_2\|u\|_2 \cos \theta=\|\nabla f\|_2\cos \theta$,变化率由$cos\theta$决定。$u$和梯度$\nabla f(x,y)$同方向,上升最快;$u$和梯度$\nabla f(x,y)$反方向,下降最快。

参考文献:

【1】梯度的方向为什么是函数值增加最快的方向?

【2】为什么梯度的反方向是函数下降最快的方向?

【3】方向导数公式的证明

猜你喜欢

转载自www.cnblogs.com/nxf-rabbit75/p/11240338.html
今日推荐