• Gradient


    In vector calculus, the gradient of a scalar-valued differentiable function f of several variables is the vector field (or vector-valued function) {\displaystyle \nabla f}\nabla f whose value at a point {\displaystyle p}p is the “direction and rate of fastest increase”. If the gradient of a function is non-zero at a point p, the direction of the gradient is the direction in which the function increases most quickly from p, and the magnitude of the gradient is the rate of increase in that direction, the greatest absolute directional derivative.[1] Further, a point where the gradient is the zero vector is known as a stationary point. The gradient thus plays a fundamental role in optimization theory, where it is used to maximize a function by gradient ascent. In coordinate-free terms, the gradient of a function {\displaystyle f({\bf {{r})}}}{\displaystyle f({\bf {{r})}}} may be defined by:

    {\displaystyle df=\nabla f\cdot d{\bf {r}}}{\displaystyle df=\nabla f\cdot d{\bf {r}}}
    where df is the total infinitesimal change in f for an infinitesimal displacement {\displaystyle d{\bf {r}}}{\displaystyle d{\bf {r}}}, and is seen to be maximal when {\displaystyle d{\bf {r}}}{\displaystyle d{\bf {r}}} is in the direction of the gradient {\displaystyle \nabla f}\nabla f. The nabla symbol {\displaystyle \nabla }\nabla , written as an upside-down triangle and pronounced “del”, denotes the vector differential operator.

    When a coordinate system is used in which the basis vectors are not functions of position, the gradient is given by the vector[a] whose components are the partial derivatives of {\displaystyle f}f at {\displaystyle p}p.[2] That is, for {\displaystyle f\colon \mathbb {R} ^{n}\to \mathbb {R} }{\displaystyle f\colon \mathbb {R} ^{n}\to \mathbb {R} }, its gradient {\displaystyle \nabla f\colon \mathbb {R} ^{n}\to \mathbb {R} ^{n}}{\displaystyle \nabla f\colon \mathbb {R} ^{n}\to \mathbb {R} ^{n}} is defined at the point {\displaystyle p=(x_{1},\ldots ,x_{n})}{\displaystyle p=(x_{1},\ldots ,x_{n})} in n-dimensional space as the vector[b]

    {\displaystyle \nabla f§={

    \begin{bmatrix}{\frac {\partial f}{\partial x_{1}}}§\\vdots \{\frac {\partial f}{\partial x_{n}}}§\end{bmatrix}" role="presentation">\begin{bmatrix}{\frac {\partial f}{\partial x_{1}}}§\\vdots \{\frac {\partial f}{\partial x_{n}}}§\end{bmatrix}
    }.}{\displaystyle \nabla f§={
    \begin{bmatrix}{\frac {\partial f}{\partial x_{1}}}§\\vdots \{\frac {\partial f}{\partial x_{n}}}§\end{bmatrix}" role="presentation">\begin{bmatrix}{\frac {\partial f}{\partial x_{1}}}§\\vdots \{\frac {\partial f}{\partial x_{n}}}§\end{bmatrix}
    }.}
    The gradient is dual to the total derivative {\displaystyle df}df: the value of the gradient at a point is a tangent vector – a vector at each point; while the value of the derivative at a point is a cotangent vector – a linear functional on vectors.[c] They are related in that the dot product of the gradient of f at a point p with another tangent vector v equals the directional derivative of f at p of the function along v; that is, {\textstyle \nabla f§\cdot \mathbf {v} ={\frac {\partial f}{\partial \mathbf {v} }}§=df_{p}(\mathbf {v} )}{\textstyle \nabla f§\cdot \mathbf {v} ={\frac {\partial f}{\partial \mathbf {v} }}§=df_{p}(\mathbf {v} )}. The gradient admits multiple generalizations to more general functions on manifolds; see § Generalizations.

    在这里插入图片描述

    The gradient, represented by the blue arrows, denotes the direction of greatest change of a scalar function. The values of the function are represented in greyscale and increase in value from white (low) to dark (high).

    1 Motivation

    Consider a room where the temperature is given by a scalar field, T, so at each point (x, y, z) the temperature is T(x, y, z), independent of time. At each point in the room, the gradient of T at that point will show the direction in which the temperature rises most quickly, moving away from (x, y, z). The magnitude of the gradient will determine how fast the temperature rises in that direction.

    Consider a surface whose height above sea level at point (x, y) is H(x, y). The gradient of H at a point is a plane vector pointing in the direction of the steepest slope or grade at that point. The steepness of the slope at that point is given by the magnitude of the gradient vector.

    The gradient can also be used to measure how a scalar field changes in other directions, rather than just the direction of greatest change, by taking a dot product. Suppose that the steepest slope on a hill is 40%. A road going directly uphill has slope 40%, but a road going around the hill at an angle will have a shallower slope. For example, if the road is at a 60° angle from the uphill direction (when both directions are projected onto the horizontal plane), then the slope along the road will be the dot product between the gradient vector and a unit vector along the road, namely 40% times the cosine of 60°, or 20%.

    More generally, if the hill height function H is differentiable, then the gradient of H dotted with a unit vector gives the slope of the hill in the direction of the vector, the directional derivative of H along the unit vector.

    在这里插入图片描述

    Gradient of the 2D function f(x, y) = xe−(x2 + y2) is plotted as blue arrows over the pseudocolor plot of the function.

    2 Notation

    3 Definition

    3.1 Cartesian coordinates

    3.2 Cylindrical and spherical coordinates

    3.3 General coordinates

    4 Relationship with derivative

    4.1 Relationship with total derivative

    4.1.1 Differential or (exterior) derivative

    4.1.2 Linear approximation to a function

    4.2 Relationship with Fréchet derivative

    5 Further properties and applications

    5.1 Level sets

    5.2 Conservative vector fields and the gradient theorem

    6 Generalizations

    6.1 Jacobian

    6.2 Gradient of a vector field

    6.3 Riemannian manifolds

    7 See also

  • 相关阅读:
    anaconda安装pytorch
    Pytorch入门进行迁移学习实现自行车分类识别:模型迁移训练与效果评估
    电脑技巧:推荐4个冷门且功能非常强大的效率工具
    【毕业设计】单片机 图像分类 智能识别机器人 - 物联网 深度学习 AI
    Qt+sqlite3使用事务提升插入效率
    C. 3SUM Closure
    Rust for Linux:世界上最大的软件项目的内存安全问题有办法了!
    计算机毕业设计php+vue基于微信小程序的叽喳音乐播放小程序
    go类型断言类型转换
    华云数据×天融信 | 提升云安全能力 联合打造“数据中心云安全资源池解决方案”
  • 原文地址:https://blog.csdn.net/qq_66485519/article/details/128177022