1 / 12

Local search algorithms

Local search algorithms. Most local search algorithms are based on derivatives to guide the search. For differentiable function it has been shown that even if you need to calculate derivatives by finite differences, derivative-based algorithms are better than ones that do not use derivatives.

leala
Télécharger la présentation

Local search algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Local search algorithms • Most local search algorithms are based on derivatives to guide the search. • For differentiable function it has been shown that even if you need to calculate derivatives by finite differences, derivative-based algorithms are better than ones that do not use derivatives. • However, we will start with Nelder-Mead sequential simplex algorithm that can deal with non-differentiable functions, and even with some discontinuities.

  2. Nelder Mead Sequential Simplex Algorithm • An old local-search algorithm that contains the ingredients of modern search techniques: • No derivatives • Population based • Simple idea that does not require much mathematics • Basis for Matlab’sfminsearch testimonial to its robustness. • Simplex is the simplest body in n dimensions • Has n+1 vertices (triangle in 2D and tetrahedron in 3D)

  3. Sequential Simplex Method (Mostly from Wikipedia and Matlab) • In n dimensional space start with n+1 vertices of a selected simplex, evaluate the function there and order points by function value • Calculate x0, the center of gravity of all the points except xn+1 • Reflect xn+1 about x0 • If new point is better than 2nd worst, but not best, use to replace worst and go back to step 1. • Reflect worst point about c.g. • Read about expansion and contraction

  4. Expansion and contraction • Expansion (new point is best) • Contraction (new point is worst than 2nd worst)

  5. Reduction (shrinkage) • If the contracted point is not better than worst, then contract all points about the best one

  6. Problems Nelder Mead operators • For a 2D problem, the current simplex has f(0,0)=1, f(1,0)=2, f(0,1)=3. Where will you evaluate f next? • If the next two points gave us function values of 4 and 5, respectively, where will you evaluate the function next? • If instead, the next point gave us a function value of 0, where will you evaluate the function next?

  7. Rosenbrock Banana function • Various versions • This is from Wikeipedia (minimum at (1,1))

  8. Generating first 20 points for Banana function global z2; global yg; global z1 global count count =1; options=optimset('MaxFunEvals',20) [x,fval] = fminsearch(@banana,[-1.2, 1],options) mat=[z1;z2;yg] function [y]=banana(x) global z1; global z2; global yg global count y=100*(x(2)-x(1)^2)^2+(1-x(1))^2; z1(count)=x(1); z2(count)=x(2); yg(count)=y; count=count+1; mat = Columns 1 through 8 -1.200 -1.260 -1.200 -1.140 -1.080 -1.080 -1.020 -0.960 1.000 1.000 1.050 1.050 1.075 1.125 1.1875 1.150 24.20 39.64 20.05 10.81 5.16 4.498 6.244 9.058 Columns 9 through 16 -1.020 -1.020 -1.065 -1.125 -1.046 -1.031 -1.007 -1.013 1.125 1.175 1.100 1.100 1.119 1.094 1.078 1.113 4.796 5.892 4.381 7.259 4.245 4.218 4.441 4.813

  9. 1.09 1.08 5.16 1.07 10.81 1.06 20.05 1.05 1.04 1.03 1.02 24.2 1.01 39.6 1 -1.26 -1.24 -1.22 -1.2 -1.18 -1.16 -1.14 -1.12 -1.1 -1.08 -1.06 Reflection and expansion .

  10. Next iteration 20.05 5.16 24.2

  11. Complete search examples from Wikipedia • http://en.wikipedia.org/wiki/Nelder-Mead_method • Shows progress for the Banana function as well as for Himmelblau’s function.

  12. Problem fminsearch • Track and plot the first few iterations of fminsearch on Himmelblau’s function starting from (1,1).

More Related