Skip to content

Commit

Permalink
Test Case
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Blank committed May 4, 2020
1 parent 19fae10 commit c238f79
Show file tree
Hide file tree
Showing 61 changed files with 2,580 additions and 382 deletions.
34 changes: 17 additions & 17 deletions doc/source/algorithms/cmaes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
"output_type": "stream",
"text": [
"Best solution found: \n",
"X = [0.49999997 0.50000003 0.5 0.50000003 0.5 0.49999998\n",
" 0.50000004 0.50000002 0.50000004 0.5 ]\n",
"F = [0.49999997 0.50000003 0.5 0.50000003 0.5 0.49999998\n",
" 0.50000004 0.50000002 0.50000004 0.5 ]\n",
"X = [0.49999997 0.49999994 0.5 0.49999996 0.5 0.5\n",
" 0.49999996 0.5 0.50000003 0.50000004]\n",
"F = [0.49999997 0.49999994 0.5 0.49999996 0.5 0.5\n",
" 0.49999996 0.5 0.50000003 0.50000004]\n",
"CV= [0.]\n"
]
}
Expand Down Expand Up @@ -95,20 +95,20 @@
"==============================================================================\n",
"n_gen | n_eval | fopt | sigma | min std | max std | axis \n",
"==============================================================================\n",
" 1 | 60 | 0.229388258 | 0.500000000 | 0.50000 | 0.50002 | 1.00005\n",
" 2 | 70 | 0.229388258 | 0.472048869 | 0.45411 | 0.48055 | 1.16540\n",
" 3 | 80 | 0.229388258 | 0.443735415 | 0.40077 | 0.45473 | 1.27878\n",
" 4 | 90 | 0.229388258 | 0.430768024 | 0.37538 | 0.45674 | 1.31680\n",
" 5 | 100 | 0.229388258 | 0.416239839 | 0.36077 | 0.43775 | 1.31471\n",
" 6 | 110 | 0.229388258 | 0.385521255 | 0.33371 | 0.40067 | 1.31705\n",
" 7 | 120 | 0.229388258 | 0.362530665 | 0.30712 | 0.37591 | 1.36952\n",
" 8 | 130 | 0.229388258 | 0.362002271 | 0.30015 | 0.39686 | 1.45054\n",
" 9 | 140 | 0.229388258 | 0.374270117 | 0.30254 | 0.42601 | 1.61807\n",
" 10 | 150 | 0.229388258 | 0.373933647 | 0.30242 | 0.44002 | 1.70848\n",
" 1 | 60 | 0.413583651 | 0.500000000 | 0.50000 | 0.50002 | 1.00005\n",
" 2 | 70 | 0.413583651 | 0.443532600 | 0.42922 | 0.44527 | 1.10591\n",
" 3 | 80 | 0.413583651 | 0.406582613 | 0.37335 | 0.41067 | 1.17817\n",
" 4 | 90 | 0.413583651 | 0.384570210 | 0.34673 | 0.39056 | 1.20631\n",
" 5 | 100 | 0.413583651 | 0.374835420 | 0.33287 | 0.41146 | 1.32408\n",
" 6 | 110 | 0.413583651 | 0.365537593 | 0.31713 | 0.40771 | 1.39290\n",
" 7 | 120 | 0.413583651 | 0.394854291 | 0.34417 | 0.42415 | 1.46804\n",
" 8 | 130 | 0.413583651 | 0.416364366 | 0.35289 | 0.44742 | 1.55281\n",
" 9 | 140 | 0.413583651 | 0.389834619 | 0.32470 | 0.42030 | 1.65435\n",
" 10 | 150 | 0.413583651 | 0.373800540 | 0.30839 | 0.39783 | 1.65274\n",
"Best solution found: \n",
"X = [0.48607456 0.53766803 0.56779226 0.44460432 0.43884118 0.57589736\n",
" 0.37938045 0.1263826 0.26892292 0.44455163]\n",
"F = [0.22938826]\n"
"X = [0.36998631 0.38142292 0.55648563 0.73116207 0.84201565 0.31814345\n",
" 0.41297808 0.4460369 0.7083321 0.84937005]\n",
"F = [0.41358365]\n"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion doc/source/algorithms/moead.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions doc/source/algorithms/nelder_mead.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[0.49977236 0.49995608 0.50006502 0.50014803 0.50029494 0.50009887\n",
"Best solution found: \n",
"X = [0.49977236 0.49995608 0.50006502 0.50014803 0.50029494 0.50009887\n",
" 0.4992701 0.49963783 0.49968202 0.49961358]\n",
"[1.09100991e-06]\n"
"F = [1.09100991e-06]\n"
]
}
],
Expand All @@ -50,8 +51,7 @@
" seed=1,\n",
" verbose=False)\n",
"\n",
"print(res.X)\n",
"print(res.F)\n"
"print(\"Best solution found: \\nX = %s\\nF = %s\" % (res.X, res.F))"
]
},
{
Expand Down
113 changes: 13 additions & 100 deletions doc/source/algorithms/pattern_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
"## Pattern Search (Hooke and Jeeves)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"An implementation of well-known Hooke and Jeeves Pattern Search <cite data-cite=\"pattern_search\"></cite> for single-objective optimization which makes use of *exploration* and *pattern* moves in an alternating manner. \n",
"For now, we like to refer to [Wikipedia](https://en.wikipedia.org/wiki/Pattern_search_(optimization)) for more information such as pseudo code and visualizations in the search space."
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand All @@ -27,109 +35,16 @@
"name": "stdout",
"output_type": "stream",
"text": [
"=============================================\n",
"n_gen | n_eval | fopt | delta \n",
"=============================================\n",
" 1 | 150 | 2.07242E+01 | 0.250000000\n",
" 2 | 258 | 1.73176E+01 | 0.125000000\n",
" 3 | 371 | 1.19990E+01 | 0.062500000\n",
" 4 | 480 | 6.691999557 | 0.031250000\n",
" 5 | 593 | 4.217183223 | 0.015625000\n",
" 6 | 705 | 3.022213443 | 0.007812500\n",
" 7 | 813 | 1.622057902 | 0.003906250\n",
" 8 | 922 | 0.689752457 | 0.001953125\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" 9 | 1031 | 0.169017578 | 0.000976562\n",
" 10 | 1143 | 0.096961231 | 0.000488281\n",
" 11 | 1249 | 0.039341265 | 0.000244141\n",
" 12 | 1360 | 0.020167674 | 0.000122070\n",
" 13 | 1468 | 0.008760261 | 0.000061035\n",
" 14 | 1579 | 0.005303555 | 0.000030518\n",
" 15 | 1686 | 0.002180371 | 0.000015259\n",
" 16 | 1797 | 0.001281223 | 7.62939E-06\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" 17 | 1906 | 0.000581027 | 3.81470E-06\n",
" 18 | 2014 | 0.000249912 | 1.90735E-06\n",
" 19 | 2125 | 0.000160706 | 9.53674E-07\n",
" 20 | 2229 | 0.000074594 | 4.76837E-07\n",
" 21 | 2337 | 0.000038407 | 2.38419E-07\n",
" 22 | 2447 | 0.000018955 | 1.19209E-07\n",
" 23 | 2552 | 7.41422E-06 | 5.96046E-08\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" 24 | 2665 | 4.96439E-06 | 2.98023E-08\n",
" 25 | 2776 | 2.19302E-06 | 1.49012E-08\n",
" 26 | 2884 | 1.20844E-06 | 7.45058E-09\n",
" 27 | 2994 | 5.17797E-07 | 3.72529E-09\n",
" 28 | 3106 | 2.53576E-07 | 1.86265E-09\n",
" 29 | 3216 | 1.17129E-07 | 9.31323E-10\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" 30 | 3326 | 7.89935E-08 | 4.65661E-10\n",
" 31 | 3435 | 3.41790E-08 | 2.32831E-10\n",
" 32 | 3547 | 1.47156E-08 | 1.16415E-10\n",
" 33 | 3660 | 8.73876E-09 | 5.82077E-11\n",
" 34 | 3770 | 4.41282E-09 | 2.91038E-11\n",
" 35 | 3876 | 1.94904E-09 | 1.45519E-11\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" 36 | 3987 | 1.08801E-09 | 7.27596E-12\n",
" 37 | 4097 | 5.30143E-10 | 3.63798E-12\n",
" 38 | 4205 | 3.24562E-10 | 1.81899E-12\n",
" 39 | 4313 | 1.41708E-10 | 9.09495E-13\n",
" 40 | 4421 | 6.99107E-11 | 4.54747E-13\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" 41 | 4528 | 3.66858E-11 | 2.27374E-13\n",
" 42 | 4635 | 1.65241E-11 | 1.13687E-13\n",
" 43 | 4742 | 9.94449E-12 | 5.68434E-14\n",
" 44 | 4846 | 4.21396E-12 | 2.84217E-14\n",
" 45 | 4957 | 2.18536E-12 | 1.42109E-14\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" 46 | 5064 | 1.00231E-12 | 7.10543E-15\n",
" 47 | 5173 | 5.68878E-13 | 3.55271E-15\n",
" 48 | 5281 | 2.88214E-13 | 1.77636E-15\n",
"[-9.27771855e-14 -2.97851640e-14 -1.26925499e-15 8.91408665e-14\n",
"Best solution found: \n",
"X = [-9.27771855e-14 -2.97851640e-14 -1.26925499e-15 8.91408665e-14\n",
" -1.19684856e-14 -6.66560896e-14 8.11832539e-14 -8.68501150e-14\n",
" 6.93977971e-14 -8.47269999e-14 -1.22541465e-13 1.15618649e-13\n",
" 5.49523346e-14 4.71786414e-14 -8.61731588e-14 -6.07986908e-14\n",
" 1.00688146e-13 -3.36770408e-14 3.38081544e-14 8.86496611e-14\n",
" -5.67424639e-14 7.34497267e-14 -7.59578144e-14 -2.42403699e-14\n",
" 3.69602818e-14 -6.67519772e-14 4.79715018e-14 2.70083653e-14\n",
" -1.01982970e-13 -8.13052041e-14]\n",
"[2.88213897e-13]\n",
"[0.]\n"
"F = [2.88213897e-13]\n"
]
}
],
Expand All @@ -145,11 +60,9 @@
"res = minimize(problem,\n",
" algorithm,\n",
" seed=1,\n",
" verbose=True)\n",
" verbose=False)\n",
"\n",
"print(res.X)\n",
"print(res.F)\n",
"print(res.CV)\n"
"print(\"Best solution found: \\nX = %s\\nF = %s\" % (res.X, res.F))"
]
},
{
Expand Down
10 changes: 0 additions & 10 deletions doc/source/api/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,33 @@ Model
:members:

.. autoclass:: pymoo.model.sampling.Sampling
:noindex:
:members:

.. autoclass:: pymoo.model.selection.Selection
:noindex:
:members:

.. autoclass:: pymoo.model.mutation.Mutation
:noindex:
:members:

.. autoclass:: pymoo.model.crossover.Crossover
:noindex:
:members:

.. autoclass:: pymoo.model.survival.Survival
:noindex:
:members:

.. autoclass:: pymoo.model.termination.Termination
:noindex:
:members:

.. autoclass:: pymoo.model.indicator.Indicator
:noindex:
:members:

.. autoclass:: pymoo.model.population.Population
:noindex:
:members:

.. autoclass:: pymoo.model.individual.Individual
:noindex:
:members:

.. autoclass:: pymoo.model.result.Result
:noindex:
:members:


2 changes: 1 addition & 1 deletion doc/source/customization/binary_problem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion doc/source/customization/custom.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion doc/source/customization/discrete_problem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
56 changes: 30 additions & 26 deletions doc/source/customization/initialization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@
"============================================================\n",
"n_gen | n_eval | igd | gd | hv \n",
"============================================================\n",
" 1 | 300 | 3.630976687 | 3.776132697 | 0.00000E+00\n",
" 2 | 400 | 3.630259816 | 3.752439367 | 0.00000E+00\n",
" 3 | 500 | 3.418933759 | 3.753184244 | 0.00000E+00\n",
" 4 | 600 | 3.231550622 | 3.253141750 | 0.00000E+00\n",
" 5 | 700 | 2.948499804 | 3.112957878 | 0.00000E+00\n",
" 6 | 800 | 2.863306628 | 3.027713279 | 0.00000E+00\n",
" 7 | 900 | 2.616071760 | 2.966628798 | 0.00000E+00\n",
" 8 | 1000 | 2.003671745 | 2.773862398 | 0.00000E+00\n",
" 9 | 1100 | 1.698135333 | 2.539436269 | 0.00000E+00\n",
" 10 | 1200 | 1.697809742 | 2.399161265 | 0.00000E+00\n"
" 1 | 300 | 3.481862151 | 3.891229516 | 0.00000E+00\n",
" 2 | 400 | 3.480264729 | 3.657111762 | 0.00000E+00\n",
" 3 | 500 | 3.108853324 | 3.668094382 | 0.00000E+00\n",
" 4 | 600 | 3.108853324 | 3.137531238 | 0.00000E+00\n",
" 5 | 700 | 2.943036924 | 2.936487925 | 0.00000E+00\n",
" 6 | 800 | 2.768143770 | 2.607942204 | 0.00000E+00\n",
" 7 | 900 | 2.768143770 | 2.565896955 | 0.00000E+00\n",
" 8 | 1000 | 2.654621380 | 2.408145325 | 0.00000E+00\n",
" 9 | 1100 | 2.326534287 | 2.256206502 | 0.00000E+00\n",
" 10 | 1200 | 2.081444601 | 2.208504133 | 0.00000E+00\n"
]
},
{
"data": {
"text/plain": [
"<pymoo.model.result.Result at 0x126760f50>"
"<pymoo.model.result.Result at 0x1188f1a50>"
]
},
"execution_count": 1,
Expand All @@ -88,9 +88,7 @@
" algorithm,\n",
" ('n_gen', 10),\n",
" seed=1,\n",
" verbose=True)\n",
"\n",
"\n"
" verbose=True)"
]
},
{
Expand All @@ -114,22 +112,28 @@
"============================================================\n",
"n_gen | n_eval | igd | gd | hv \n",
"============================================================\n",
" 1 | 0 | 3.564541316 | 3.691610570 | 0.00000E+00\n",
" 2 | 100 | 3.564541316 | 3.697683560 | 0.00000E+00\n",
" 3 | 200 | 3.093660354 | 3.796400408 | 0.00000E+00\n",
" 4 | 300 | 2.960831587 | 3.363980086 | 0.00000E+00\n",
" 5 | 400 | 2.951726529 | 3.131239167 | 0.00000E+00\n",
" 6 | 500 | 2.795768696 | 2.988585578 | 0.00000E+00\n",
" 7 | 600 | 2.581943136 | 2.459043404 | 0.00000E+00\n",
" 8 | 700 | 2.471446790 | 2.360115523 | 0.00000E+00\n",
" 9 | 800 | 2.428839630 | 2.310259426 | 0.00000E+00\n",
" 10 | 900 | 2.304383703 | 2.135678386 | 0.00000E+00\n"
" 1 | 0 | 3.545092213 | 3.827601216 | 0.00000E+00\n",
" 2 | 100 | 3.545092213 | 3.825368934 | 0.00000E+00\n",
" 3 | 200 | 3.366254282 | 3.522554883 | 0.00000E+00\n",
" 4 | 300 | 2.966148158 | 3.111186346 | 0.00000E+00\n",
" 5 | 400 | 2.663611694 | 3.096243735 | 0.00000E+00\n",
" 6 | 500 | 2.663611694 | 2.924202265 | 0.00000E+00\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
" 7 | 600 | 2.372672075 | 2.692961803 | 0.00000E+00\n",
" 8 | 700 | 2.372672075 | 2.395526868 | 0.00000E+00\n",
" 9 | 800 | 2.146421941 | 2.232161323 | 0.00000E+00\n",
" 10 | 900 | 2.016162053 | 2.191762693 | 0.00000E+00\n"
]
},
{
"data": {
"text/plain": [
"<pymoo.model.result.Result at 0x118955610>"
"<pymoo.model.result.Result at 0x1184f19d0>"
]
},
"execution_count": 2,
Expand Down Expand Up @@ -159,7 +163,7 @@
" algorithm,\n",
" ('n_gen', 10),\n",
" seed=1,\n",
" verbose=True)\n"
" verbose=True)"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion doc/source/customization/mixed_variable_problem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit c238f79

Please sign in to comment.