Gradient einer Funktion
siehe Partielle Ableitung
Der Gradient ist ein Vektor mit den Partielle Ableitung als Komponenten eines
Skalarfeld . Dieser Vektor zeigt in an der Stelle x ⃗ \vec{x} x in die Richtung des höchsten Anstiegs.
Definition : Für eine differenzierbare skalare Funktion f : D → R , D ∈ R n f: D \to \mathbb{R}, D \in \mathbb{R}^n f : D → R , D ∈ R n heißt
grad x ⃗ f : = ∇ ⃗ x ⃗ f : = ( ∂ f ∂ x 1 ( x ⃗ ) ⋮ ∂ f ∂ x n ( x ⃗ ) ) = ( ∂ f ∂ x 1 ( x ⃗ ) , … , ∂ f ∂ x n ( x ⃗ ) ) T \text{grad}_{\vec{x}} f:=\vec{\nabla}_{\vec{x}} f:=\left(\begin{array}{c}
\frac{\partial f}{\partial x_1}(\vec{x}) \\
\vdots \\
\frac{\partial f}{\partial x_n}(\vec{x})
\end{array}\right)=\left(\frac{\partial f}{\partial x_1}(\vec{x}), \ldots, \frac{\partial f}{\partial x_n}(\vec{x})\right)^T grad x f := ∇ x f := ∂ x 1 ∂ f ( x ) ⋮ ∂ x n ∂ f ( x ) = ( ∂ x 1 ∂ f ( x ) , … , ∂ x n ∂ f ( x ) ) T
Der Nabla-Operator ∇ \nabla ∇ wird hier auf ein Skalarfeld angewendet und erzeugt ein
Vektorfeld .
Gradient um f f f an der Stelle x ⃗ \vec{x} x .
Mithilfe des Gradienten kann man auch die Ableitung in eine bestimmte Richtung u ⃗ \vec{u} u , wobei ∣ u ⃗ ∣ = 1 |\vec{u}|=1 ∣ u ∣ = 1 ,
berechnen:
∇ x ⃗ f ⋅ u ⃗ = ∂ f ∂ u ⃗ . \nabla_{\vec{x}}f \cdot \vec{u} = \frac{ \partial f }{ \partial \vec{u} } . ∇ x f ⋅ u = ∂ u ∂ f .
Ein Beispiel :
f ( x , y , z ) = x 2 y + y e 3 z g r a d x , y , z f = ( 2 x y x 2 + e 3 z 3 y e 3 z ) f(x, y, z) = x^{2}y + y e^{3z} \quad grad_{x, y, z}f = \begin{pmatrix}
2xy \\
x^{2} + e^{3z} \\
3y e^{3z}
\end{pmatrix} f ( x , y , z ) = x 2 y + y e 3 z g r a d x , y , z f = 2 x y x 2 + e 3 z 3 y e 3 z
1. Geometrische Bedeutung Des Gradienten
Der Gradient zeigt in Richtung des stärksten Anstiegs (-> deswegen interessant in ML Trainingsfunktionen!)
die Länge des Gradienten ist der stärkste Anstieg.
Die Funktion fällt entgegengesetzt zum Gradienten am stärksten ab.
Der Gradient steht senkrecht (orthogonal) auf den Niveaus.
2. Ein Beispiel
f ( x , y , z ) = e 5 y sin ( x ) + 2 z f(x, y, z) = e^{ 5y } \sin(x) + 2z f ( x , y , z ) = e 5 y sin ( x ) + 2 z
∇ f ( x , y , z ) = [ e 5 y cos ( x ) 5 e 5 y sin ( x ) 2 ] \nabla f(x, y, z) = \begin{bmatrix}
e^{ 5y } \cos(x) \\
5e^{ 5y } \sin(x) \\
2
\end{bmatrix} ∇ f ( x , y , z ) = e 5 y cos ( x ) 5 e 5 y sin ( x ) 2
∇ f ( 0 , 1 , 0 ) = [ e 5 0 2 ] \nabla f(0, 1, 0) = \begin{bmatrix}
e^{ 5 } \\
0 \\
2
\end{bmatrix} ∇ f ( 0 , 1 , 0 ) = e 5 0 2
∂ f ∂ v ( 0 , 1 , 0 ) = ⟨ [ e 5 0 2 ] , 1 3 [ 2 2 1 ] ⟩ = 2 3 ( e 5 + 1 ) \frac{ \partial f }{ \partial v } (0, 1, 0) = \left\langle \begin{bmatrix}
e^{ 5 } \\
0 \\
2
\end{bmatrix}, \frac{1}{3} \begin{bmatrix}
2 \\
2 \\
1
\end{bmatrix} \right\rangle = \frac{2}{3} (e^{ 5 } + 1) ∂ v ∂ f ( 0 , 1 , 0 ) = ⟨ e 5 0 2 , 3 1 2 2 1 ⟩ = 3 2 ( e 5 + 1 )
wenn unsere Abbildung selbst ein Vektor ist, erhalten wir eine Matrix, in welcher wir in jeder Spalte den Vektor nach
der gegebenen Variable ableiten.
g ( x , y , z ) = [ e 3 x z 2 x + 2 y + 3 z ] g(x, y, z) = \begin{bmatrix}
e^{ 3x } z^{2} \\
x + 2y + 3z
\end{bmatrix} g ( x , y , z ) = [ e 3 x z 2 x + 2 y + 3 z ]
∇ g ( x , y , z ) = [ 3 e 3 x z 2 0 2 e 3 x z 1 2 3 ] \nabla g(x, y, z) = \begin{bmatrix}
3 e^{ 3x }z^{2} & 0 & 2e^{ 3x }z \\
1 & 2 & 3
\end{bmatrix} ∇ g ( x , y , z ) = [ 3 e 3 x z 2 1 0 2 2 e 3 x z 3 ]
Der Gradient der Funktion ist die Richtung des steilsten Anstiegs.