Pál László Gazdaság- és Humántudományok Kar, Sapientia EMTE, Csíkszereda 6. Matematika és Informatika Alkalmazásokkal Konferencia Csíkszereda, 2015. november 13-15.
Outline 1 Bevezető A feladat Direkt kereső eljárások 2 Az UNIRANDI helyi kereső eljárás A módosított UNIRANDI eljárás Célok 3
A feladat Direkt kereső eljárások A feladat Intervallum-korlátos feladat: min f(x), x D ahol D = {x l x u} R n, és x,l,u R n. f-nek nem létezik a deriváltja Költséges a derivált kiszámítása Derivált-mentes optimalizálás Direkt kereső eljárások
A feladat Direkt kereső eljárások Direkt kereső eljárások Megbízhatóak Alkalmazhatóak nem folytonos, nem differenciálható feladatok tanulmányozására Alkalmasak kezdeti megoldások javítására Viszonylag lassúak Könnyen implementálhatóak, párhuzamosíthatóak
Az UNIRANDI helyi kereső eljárás A módosított UNIRANDI eljárás Célok Az UNIRANDI helyi kereső eljárás Egy véletlen-séta alapú kereső módszer 1 2 Két lépés: véletlen irányok generálása és vonalmenti keresés a jó irányok mentén Része a GLOBAL optimalizáló eljárásnak UNIRANDI javítások 3 1 T. Järvi, A random search optimizer with an application to a maxmin problem, Publications of the Institute for Applied Mathematics, University of Turku, 1973. 2 T. Csendes, Nonlinear parameter estimation by global optimization effciency and reliability, Acta Cybernetica, vol. 8, no. 4, pp. 361 370, 1988 3 T. Csendes, L. Pál, J.O.H. Sendín, J.R. Banga. The GLOBAL Optimization Method Revisited, Optimization Letters, 2:445 454, 2008.
Az UNIRANDI helyi kereső eljárás A módosított UNIRANDI eljárás Célok Az UNIRANDI algoritmus Function UNIRANDI(f, x, h) while convergence criterion is not satisfied do Generate random direction d x new x +h d if f(x new) < f(x) then x LineSearch(f,x new,x,d,h) h 0.5 h continue d d x new x +h d if f(x new) < f(x) then x LineSearch(f,x new,x,d,h) h 0.5 h continue h 0.5 h return x, f(x) Function LineSearch(f, x new, x, d, h) while f(x new) < f(x) do x x new h 2 h x new x +h d return x
Az UNIRANDI helyi kereső eljárás A módosított UNIRANDI eljárás Célok A módosított UNIRANDI eljárás Bizonyos számú sikeres vonalmenti keresés után, újabb kereséseket hajtunk végre ígéretes irányok mentén x2 x0 x2 rd2 rd1 x1 x0 Hasonló lépést alkalmaznak ismert koordináta menti kereső algoritmusok (pld. Rosenbrock, Powell, Hooke-Jeeves)
Az UNIRANDI helyi kereső eljárás A módosított UNIRANDI eljárás Célok A módosított UNIRANDI algoritmus Function UNIRANDI(f, x, h) x 0 x while convergence criterion is not satisfied do while itr < maxiters do Generate random direction d x new x + h d if f(x new) < f(x) then x LineSearch(f,x new,x,d,h) h 0.5 h continue d d x new x + h d if f(x new) < f(x) then x LineSearch(f,x new,x,d,h) h 0.5 h continue h 0.5 h x x 2 0 x 4 x 5 x 3 rd 3 x x 3 0 x 2 x x rd 2 0 2 rd x 1 x 1 0 Keresés az x 3 x 0 és x 2 x 0 irányok mentén. d x x 0 x 0 x x new x + h d if f(x new) < f(x) then x LineSearch(f,x new,x,d,h) h 0.5 h continue return x, f(x)
Az UNIRANDI helyi kereső eljárás A módosított UNIRANDI eljárás Célok Célok Az új UNIRANDI összehasonĺıtása a GLOBAL részeként standard tesztfüggvényeket használva: A régi változattal Rosenbrock 4, Powell 5, Hooke-Jeeves 6 módszerekkel A BOBYQA 7 helyi keresővel Összehasonĺıtási szempontok: megbízhatóság, hatékonyság 4 H.H. Rosenbrock. An Automatic Method for Finding the Greatest or Least Value of a Function, Comput J, 3(3):175 184, 1960. 5 M.J.D. Powell. An efficient method for finding the minimum of a function of several variables without calculating derivatives, Comput J, 7(2):155 162, 1964. 6 R. Hooke, T.A. Jeeves. Direct search solution of numerical and statistical problems, J ACM, 8(2):212 229, 1961. 7 M.J.D. Powell. The BOBYQA algorithm for bound constrained optimization without derivatives. Tech. Rep. NA2009/06, Department of Applied Mathematics and Theoretical Physics, University of Cambridge, Cambridge, 2009.
GLOBAL + local search (Unirandi, Rosenbrock, Powell, Hooke-Jeeves, BOBYQA) 63 tesztfüggvény Függvény jellemzők: unimodális, multimodális, szétválasztható, nem-szétválasztható, rosszul kondicionált Dimenziók: 2-60 4 Colville function 2 Perm (4,10) function 2 Powell function 3.5 3 1.5 1.5 2.5 1 1 2 0.5 1.5 0.5 0 1 0.5 0.5 0 1 0 0.5 0.5 1.5 1 2 1.5 1 0.5 0 0.5 1 1.5 2 1 1 0.5 0 0.5 1 1.5 2 2 2 1 0 1 2 1 Cigar function 10 Levy function 0.8 8 0.6 6 0.4 4 0.2 2 0 0 0.2 2 0.4 4 0.6 6 0.8 1 10 5 0 5 10 8 10 Egy 10 módosított 5 0 direkt5 kereső10 eljárás vizsgálata
- Beálĺıtások GLOBAL: 50 DIM mintapont, a 2 legjobb pontot klaszterezzük 50 független futtatás Egy futtatás (trial) sikeres, ha f f 10 8 teljesül Maximális megengedett függvényhívások száma: 2 10 4 DIM Maximális megengedett függvényhívások száma egy helyi keresőben: 2 10 4 DIM/2 Összehasonĺıtási kritériumok: Átlagos függvényhívások száma, sikerességi ráta (SR - success rate), CPU idő Átlagos (medián) hiba értéke, Wilcoxon teszt
UNIRANDI iterációszám beálĺıtása Maximális iterációszám beálĺıtása Iterations DIM 0.5 DIM 2 3 3 4 9 14 18 27 37 47 95 DIM 2 3 4 5 10 15 20 30 40 50 100 DIM + 0.5 DIM 2 3 5 6 11 16 22 32 43 53 105 Konvergencia grafikonok: 10 6 10 4 Rosenbrock function 5D DIM floor(0.5*sqrt(dim)) DIM DIM+floor(0.5*sqrt(DIM)) 10 6 10 4 Rosenbrock function 20D DIM floor(0.5*sqrt(dim)) DIM DIM+floor(0.5*sqrt(DIM)) 10 6 10 4 Cigar function 20D DIM floor(0.5*sqrt(dim)) DIM DIM+floor(0.5*sqrt(DIM)) 10 2 10 2 10 2 ftarget fbest 10 0 10 2 ftarget fbest 10 0 10 2 ftarget fbest 10 0 10 2 10 4 10 4 10 4 10 6 10 6 10 6 10 8 0 500 1000 1500 2000 2500 Number of function evaluations 10 8 0 0.5 1 1.5 2 2.5 Number of function evaluations x 10 4 10 8 0 0.5 1 Number of function evaluations 1.5 2 x 10 10 6 10 4 Ellipse function 20D DIM floor(0.5*sqrt(dim)) DIM DIM+floor(0.5*sqrt(DIM)) 10 6 10 4 Trid function 10D DIM floor(0.5*sqrt(dim)) DIM DIM+floor(0.5*sqrt(DIM)) 10 6 10 4 Sum squares 30D DIM floor(0.5*sqrt(dim)) DIM DIM+floor(0.5*sqrt(DIM)) 10 2 10 2 10 2 ftarget fbest 10 0 10 2 ftarget fbest 10 0 10 2 ftarget fbest 10 0 10 2 10 4 10 4 10 4 10 6 10 6 10 6 10 8 0 0.5 1 1.5 2 2.5 3 Number of function evaluations x 10 4 10 8 0 500 1000 1500 2000 2500 3000 3500 4000 Number of function evaluations 10 8 0 1000 2000 3000 4000 5000 6000 7000 8000 Number of function evaluations
Hatékonyság és megbízhatóság elemzése Function UNIR nunir dim NFE SR(%) CPU NFE SR(%) CPU Cigar 5 66592 44 0.6462 612 100 0.0197 Cigar 40-0 6.0329 7364 100 0.1641 Cigar-rot 5-0 1.5138 1130 100 0.0549 Cigar-rot 40-0 12.9094 23006 100 0.5385 Cigar-rot 60-0 20.6302 35763 100 0.8231 Diff. Powers 5-0 0.8493 2167 100 0.0599 Diff. Powers 40-0 11.5862 90208 100 1.5363 Diff. Powers 60-0 21.7191 189536 100 3.7790 Discus 5 5791 100 0.0917 2022 100 0.0440 Discus 40 23579 100 0.2440 19735 100 0.2983 Discus-rot 5 5838 100 0.1616 4349 100 0.1504 Discus-rot 40 23900 100 0.4711 20630 100 0.5051 Discus-rot 60 30630 100 0.6396 27291 100 0.6399 Ellipsoid 5 41744 100 0.3888 1042 100 0.0334 Ellipsoid 40-0 11.4726 43640 100 0.8212 Ellipsoid-rot 5 42372 100 0.7070 4100 100 0.1466 Ellipsoid-rot 40-0 19.1557 69751 100 1.9038 Ellipsoid-rot 60-0 31.0118 114400 100 3.2570 Sum Squares 5 416 100 0.0309 439 100 0.0240 Sum Squares 40 22017 100 0.3710 8305 100 0.2178 Sum Squares 60 48684 100 0.7479 15192 100 0.3376 Sum Squares-rot 60 45729 100 1.0979 17249 100 0.4870
Hatékonyság és megbízhatóság elemzése Function UNIR nunir dim NFE SR(%) CPU NFE SR(%) CPU Colville 4 15031 100 0.1959 1722 100 0.0396 Dixon-Price 10 74512 84 0.7148 16056 100 0.2459 Perm-(4,1/2) 4 47922 4 0.9656 38715 56 0.8231 Perm-(4,10) 4 17133 2 0.9373 18905 100 0.3042 Powell 4 52089 34 0.5906 1519 100 0.0449 Powell 24-0 4.6345 45788 100 0.6040 Rosenbrock 5-0 0.7791 2215 100 0.0540 Rosenbrock 40-0 6.7152 88505 100 0.9513 Rosenbrock-rot 5-0 1.5457 2085 100 0.0858 Rosenbrock-rot 40-0 13.2822 78802 100 1.5725 Rosenbrock-rot 60-0 22.2139 145975 100 3.0592 Ackley 5 34577 100 0.3913 28172 94 0.7014 Griewank 5 51296 28 0.2137 36692 36 0.9441 Griewank 20 12224 100 0.1713 13250 100 0.2243 Levy 5 24447 94 0.3962 10395 100 0.2421 Rastrigin 4 33116 16 0.1991 37709 24 0.7969 Schaffer 2 12358 46 0.2702 10840 96 0.1563 Schwefel 5 58341 74 0.1728 45791 54 0.8702
Eltérések hibája - Wilcoxon előjeles rang próba Gyakran használt próba annak eldöntésére, hogy két algoritmus viselkedése között vannak-e szignifikáns eltérések Null hipotézis: a párosított minta mindkét mediánja azonos, vagyis a különbségük mediánja nulla Konfidencia szint: 5% (p < 0.05 - szignifikáns a különbség, h = 1 - a null hipotézis elvetése) Eredmények: 58 feladaton az új algoritmus szignifikánsan jobb 3 feladat (Easom, Griewank, Rastrigin, Schwefel) esetén a nullhipotézis nem eldobható 1 feladat (Ackley) esetén a régi módszer jobb
Eltérések hibája - Wilcoxon teszt Function UNIR nunir Wilcoxon test dim Average Median Average Median p-value h Ackley 5 7.99e-09 8.19e-09 9.88e-02 6.81e-09 3.29e-03 1 Beale 2 5.75e-09 6.19e-09 3.39e-09 2.83e-09 4.18e-04 1 Booth 2 4.23e-09 3.78e-09 3.23e-09 1.95e-09 1.10e-02 1 Branin 2 4.96e-09 4.66e-09 2.64e-09 1.92e-09 2.79e-04 1 Cigar 5 3.13e-08 1.36e-08 3.04e-09 1.87e-09 7.56e-10 1 Cigar 40 1.43e-03 1.01e-03 4.65e-09 4.49e-09 7.56e-10 1 Cigar-rot 5 2.91e-01 8.18e-02 3.31e-09 2.60e-09 7.56e-10 1 Cigar-rot 40 4.13e+00 1.48e+00 7.11e-09 7.29e-09 7.56e-10 1 Cigar-rot 60 2.66e+00 1.17e+00 6.96e-09 6.89e-09 7.56e-10 1 Colville 4 9.77e-09 9.92e-09 5.14e-09 4.55e-09 1.09e-09 1................................................
Hatékonyság és megbízhatóság elemzése Function nunir ROS POW HJ BOBYQA dim NFE SR NFE SR NFE SR NFE SR NFE SR Cigar 5 612 100 2585 100 169 100 691 100 153 100 Cigar 40 7364 100 57014 100 878 100 6533 100 568 100 Cigar-rot 5 1130 100 6379 98 526 100 41929 78 419 100 Cigar-rot 40 23006 100 195014 48 13230 100 530483 34 34706 98 Cigar-rot 60 35763 100 273616 10 20791 100-0 65093 100 Colville 4 1722 100 27782 58 1434 100 1773 100 602 100 Diff. Powers 5 2167 100-0 384 100 978 100 44529 6 Diff. Powers 40 90208 100-0 48822 96 9904 100-0 Diff. Powers 60 189536 100-0 130977 100 16121 100-0 Discus 5 2022 100 28704 68 171 100 701 100 179 100 Discus 40 19735 100 117140 84 889 100 5765 100 22668 100 Discus-rot 5 4349 100 36291 6 430 100 85999 8 1426 100 Discus-rot 40 20630 100-0 37880 100 483487 90 218558 98 Discus-rot 60 27291 100-0 97143 100 718324 10 853196 34 Ellipsoid 5 1042 100 35561 10 170 100 749 100 615 100 Ellipsoid 40 43640 100-0 888 100 6444 100 21889 100 Ellipsoid-rot 5 4100 100-0 432 100 20616 100 625 100 Ellipsoid-rot 40 69751 100-0 33250 100 125040 100 111611 100 Ellipsoid-rot 60 114400 100-0 85851 100 246570 100 516127 86 Sum Squares 5 439 100 734 100 174 100 627 100 144 100 Sum Squares 40 8305 100 5521 4 922 100 7391 100 445 100 Sum Squares 60 15192 100-0 1287 100 11067 100 5297 100 Sum Sq.-rot 60 17249 100-0 21230 100 60594 100 40438 100
Hatékonyság és megbízhatóság elemzése Function nunir ROS POW HJ BOBYQA dim NFE SR NFE SR NFE SR NFE SR NFE SR Perm-(4,1/2) 4 38715 56-0 28830 16-0 10526 98 Perm-(4,10) 4 18905 100 28717 4 12698 56 31054 76 2184 100 Powell 4 1519 100 25419 66 777 100 17356 62 624 100 Powell 24 45788 100-0 115469 58-0 62171 100 Rosenbrock 5 2215 100 42586 60 15990 98 2998 100 927 100 Rosenbrock 40 88505 100-0 - 0 46755 100 30261 100 Rosenbrock-rot 5 2085 100 36163 70 7985 96 11144 100 864 100 Rosenbrock-rot 40 78802 100-0 - 0 311145 30 86590 100 Rosenbrock-rot 60 145975 100-0 - 0 901838 12 422105 90 Sharpridge 5 1102 100 52598 36 38662 2-0 - 0 Sharpridge 40 69836 100-0 - 0-0 - 0 Zakharov 5 534 100 4525 100 660 100 869 100 554 100 Zakharov 40 17984 100-0 61444 100-0 306426 86 Zakharov 60 16310 100 138182 96 57541 100 351 64 132554 90 Zakharov-rot 60 37109 100-0 157252 100-0 773332 32 Ackley 5 28172 94-0 - 0-0 1500 100 Griewank 5 36692 36 55030 28-0 57189 36 19350 38 Griewank 20 13250 100 123384 84 97402 62 25775 100 3050 100 Levy 5 10395 100 31455 88 8544 12 27775 100 1062 100 Rastrigin 4 37709 24 41207 20 351 2 32780 24 30635 38 Schaffer 2 10840 96 5351 100 8123 10 16775 34 3358 100 Schwefel 5 45791 54 40716 44-0 47510 18 18090 94
Eltérések hibája a teljes függvényhalmazra 10 5 10 5 10 0 10 0 10 5 Average error values 10 10 10 15 10 20 Median error values 10 5 10 10 10 25 10 15 10 30 UNIR nunir ROB POW HJ BOBYQA 10 20 UNIR nunir ROB POW HJ BOBYQA (a) Average errors (b) Median errors Local search UNIR nunir ROB POW HJ BOBYQA Sum of averages 1 299.62 55.44 2826.63 608.73 155.39 816.31 Sum of averages 2 16.68 0.86 2748.09 36.29 14.43 6.24 Sum of medians 1 274.67 1.00 2424.75 478.59 134.43 840.17 Sum of medians 2 14.50 1.00 2299.39 14.32 8.98 1.01 1 Sum of average/median errors over all functions 2 Sum of average/median errors over all functions except Ackley, Schwefel, and Sharpridge
Következtetések Az új UNIRANDI lényegesen javult mind a megbízhatóság mind a hatékonyság tekintetében Más módszerekkel összehasonĺıtva kiemelendő a módszer megbízhatósága, különösen a rosszul kondicionált feladatokon További tervek: A helyi kereső javítása az optimalizálási szakasz végén Párhuzamosítás
Köszönöm a figyelmet!