Keywords: steepest descent
Direction Based Algorithm and a Variation
‘An Introduction to Performance Optimization’ had given us a brief introduction to the optimization algorithm. And this post describes a typical direction() based algorithm and its variation gives an algorithm which is a step-length() based algorithm.
To find the minimum points of a performance index by an iterative algorithm, we want to decrease the value of performance index step by step which looks like going down from the mountain. And the key point of this algorithm is every step is going down. Every iteration makes the performance index decrease:
Our mission is to find the direction with a relatively short step length which leads us downhill.
The first-order Taylor series of an iterative step is:
where is the gradient at position of the performance index which means:
From equation(1) and equation(2) for the purpose , we need:
( , the change of , can also be represented by step length and direction , then the equation(4) has a equivalent form:
In the previous article, we have seen how to find the greatest value of then we can find the smallest value of in the same way. Then we got the smallest value this item is:
which means that the deepest direction we would search is:
According the iterative optimization algorithm frame work’An Introduction to Performance Optimization’, the second step is :
The step length is also called learning rate. And the choice of can be:
- Minimizing with by minimizing along the line:
- Fixed , such as
- Predetermined, like
- start at point
- gradient of is
- go on updating until the smallest point is achieved.
The whole trajectory looks like:
and the learning rate, step length is a constant in this algorithm, however, we can test 2 different values and watch their behavior. When we set , we have:
and when we set , we have:
The gif illustrates these:
- At first several steps, descent speed is faster than later steps
- A greater learning rate seems to have a higher speed
- This algorithm can converge to the minimum point.
The second point gives us a new idea, what will the algorithms do when we have a relatively bigger learning rate. To be on the safe side we select a not so big learning rate , we have:
this algorithm diverges, which means it would never stop at the minimum and get farther and farther as steps going on. So we have to take care of the value of learning rate, a small learning rate can slow down the algorithm but a big one can break up the algorithm.
Stable Learning Rates
To have a fast speed and converge to the minimu, we need to study the learning rate . To simplify the problem, we start with supposing the performance index is a quadratic funtion:
and we have already known its gradient is:
we take equation(11) into update step equation(8), we have:
or an equivelant form:
In the linear algebra course or other courses, this equation is called ‘linear dynamic system’. To make the system stable, the eigenvalues of are less than one in magnitude. And has the same eigenvectors with . Let be the eigenvalues of and let be the eigenvectors of
has the same eigenvectors with and has the eigenvalues:
Concerning the equation(13) and eigenvalues of to stabilize the system which here is the steepest descent algorithm, we need:
frome equation(16), we finally have
This gives us the maximum stable learning rate is inversely proportional to the maximum curvature(direction along with eigenvector according to the maximum eigenvalue ) of the quadratic function.
Let’s go back to the example, the Hessian matrix of the equation(9) is:
its eigenvectors and eigenvalues are:
taking into equation(18), we get:
so, let’s check the behavior of the algorithm when and :
- set we have:
- set we have:
Up to now, both concepts and implement have been built to prove the correctness of the algorithm. And we also have the following tips:
- The algorithm tends to converge most quickly in the direction of the eigenvector corresponding to the largest eigenvalue
- The algorithm tends to converge most slowly in the direction of the eigenvector corresponding to the smallest eigenvalue
- Do not overshoot the minimum point for the too-long step(learning rate )
- If the distinction between and , the algorithm tends to converge slowly.
Minimizing along a Line
The section above gives us the upper bound of , but we have three kinds of strategies of selecting a and the first one is "Minimizing with by minimizing along the line: ". What shall we do with this kind of ?
To arbitrary functions, the stationary point along a direction can be calculated by:
where: is the Hessian matrix of old guess :
Here we look at an example:
with the initial guess
the gradient of the function is
the initial direction of the algorithm is
and take equation(28) and into equation(23):
and take all these data into equation(8):
What is going on is repeating the steps: equation(26) to equation(30) until some terminative conditions are achieved. It works like:
All the new directions in the steps are othogonal to their last direction:
what we need now is to proof is , with the chain rule of equation(22):
equation(32) gives us: a new direction is always orthogonal to the last step direction at the minimum point of the function along the last step direction. This is also an inspiration for another algorithm called conjugate direction.