Start with a reasonable guess $\vec x_0$ and iteratively updates according to the rule:
{{#content:Q3098}}
$$
\vec x_{t+1} = \vec x_t - \eta \nabla f(\vec x_t)
$$
until $\nabla f(\vec x_n) \to \vec 0$, then $\vec x=\vec x_n$ is a '''local minimum''' of $f$.
where:
* $\vec x_t$ is the value of the $t^\text{th}$ iteration.
* $\eta \in (0,1)$ is the '''learning rate'''
* $\nabla f(\vec x_t)$ is the gradient of the function at $\vec x_t$.
<blockquote>
<blockquote>
Line 36:
Line 25:
Gradient descent is most useful for complex functions. For simple functions setting directly $\eta \nabla f(\vec x)=0$ and solve for $\vec x$ finds local extremum candidates. Evaluate $f$ at all candidate points and take the lowest value to obtain the global minimum of $f$, which is simpler and more accurate.
Gradient descent is most useful for complex functions. For simple functions setting directly $\eta \nabla f(\vec x)=0$ and solve for $\vec x$ finds local extremum candidates. Evaluate $f$ at all candidate points and take the lowest value to obtain the global minimum of $f$, which is simpler and more accurate.
until $\nabla f(\vec x_n) \to \vec 0$, then $\vec x=\vec x_n$ is a local minimum of $f$.
$\vec{x}_0$
Initial guess
$\eta\in(0,1)$
Learning rate
$\nabla f(\vec{x}_i)$
Gradient of $f$ at $\vec{x}_i$
$i$
Iteration index
$n$
Index at convergence
Why $-\nabla f$: The gradient $\nabla f$ points in the direction of the steepest ascent. To minimise the function, move in the opposite direction for the steepest descent.
Gradient descent is most useful for complex functions. For simple functions setting directly $\eta \nabla f(\vec x)=0$ and solve for $\vec x$ finds local extremum candidates. Evaluate $f$ at all candidate points and take the lowest value to obtain the global minimum of $f$, which is simpler and more accurate.
As observed, $(x_t,y_t)$ converges toward $(-1.5,1)$. Directly substituting the convergence values in, one finds $\nabla f(-1.5,1)=\vec 0$. Hence $(-1.5,1)$ is indeed a local minimum around $(0,0)$.
In some sense, ANN training is like stirring up a pile of trash: improvement is made by stirring up the weight&biases matrix ever so slightly according to current gradient, recalculate the new prediction values and new gradient, and stirring up the pile again, so on so forth until finding a $\mathbf{W}_n$ s.t. $\forall i C_i(\mathbf{W}_n)<C_\text{target}$.
Let $\mathbf{W}$ be the weight&biases matrix of an artificial neural network (ANN), $S$ be the training data set., $C_i(\mathbf{W})$ its cost function for training data point $s_i \in S$, which measures the error between the model's predictions and the true values in the training set (e.g., sum of squared errors (SSE)).
Then training is iteration with step
$$
\mathbf{W}_{t+1} = \mathbf{W}_t - \sum_{s_i \in S} \eta \nabla C_i(\mathbf{W}_t).
$$