Line search
In optimization, line search is a basic iterative approach to find a local minimum of an objective function. It first finds a descent direction along which the objective function will be reduced, and then computes a step size that determines how far should move along that direction. The descent direction can be computed by various methods, such as gradient descent or quasi-Newton method. The step size can be determined either exactly or inexactly.
One-dimensional line search
Suppose f is a one-dimensional function,, and assume that it is unimodal, that is, contains exactly one local minimum x* in a given interval . This means that f is strictly decreasing in and strictly increasing in . There are several ways to find an minimum point in this case.Zero-order methods
Zero-order methods use only function evaluations - not derivatives:- Ternary search: pick some two points b,c such that a<''b<c''<z. If f≤f, then x* must be in ; if f≥f, then x* must be in . In both cases, we can replace the search interval with a smaller one. If we pick b,''c very close to the interval center, then the interval shrinks by ~1/2 at each iteration, but we need two function evaluations per iteration. Therefore, the method has linear convergence with rate. If we pick b,c such that the partition a,b,c,z has three equal-length intervals, then the interval shrinks by 2/3 at each iteration, so the method has linear convergence with rate.
- Fibonacci search: This is a variant of ternary search in which the points b'',c are selected based on the Fibonacci sequence. At each iteration, only one function evaluation is needed, since the other point was already an endpoint of a previous interval. Therefore, the method has linear convergence with rate .
- Golden-section search: This is a variant in which the points b,''c'' are selected based on the golden ratio. Again, only one function evaluation is needed in each iteration, and the method has linear convergence with rate . This ratio is optimal among the zero-order methods.
First-order methods
First-order methods assume that f is continuously differentiable, and that we can evaluate not only f but also its derivative.- The bisection method computes the derivative of f at the center of the interval, c: if f'=0, then this is the minimum point; if f'>0, then the minimum must be in ; if f'<0, then the minimum must be in . This method has linear convergence with rate 0.5.
Curve-fitting methods
Curve-fitting methods try to attain superlinear convergence by assuming that f has some analytic form, e.g. a polynomial of finite degree. At each iteration, there is a set of "working points" in which we know the value of f. Based on these points, we can compute a polynomial that fits the known values, and find its minimum analytically. The minimum point becomes a new working point, and we proceed to the next iteration:- Newton's method is a special case of a curve-fitting method, in which the curve is a degree-two polynomial, constructed using the first and second derivatives of f. If the method is started close enough to a non-degenerate local minimum, then it has quadratic convergence.
- Regula falsi is another method that fits the function to a degree-two polynomial, but it uses the first derivative at two points, rather than the first and second derivative at the same point. If the method is started close enough to a non-degenerate local minimum, then it has superlinear convergence of order.Cubic fit fits to a degree-three polynomial, using both the function values and its derivative at the last two points. If the method is started close enough to a non-degenerate local minimum, then it has quadratic convergence.
Multi-dimensional line search
In general, we have a multi-dimensional objective function. The line-search method first finds a descent direction along which the objective function will be reduced, and then computes a step size that determines how far should move along that direction. The descent direction can be computed by various methods, such as gradient descent or quasi-Newton method. The step size can be determined either exactly or inexactly. Here is an example gradient method that uses a line search in step 5:- Set iteration counter and make an initial guess for the minimum. Pick a tolerance.
- Loop:
- # Compute a descent direction.
- # Define a one-dimensional function, representing the function value on the descent direction given the step-size.
- # Find an that minimizes over.
- # Update, and
- Until