├── .gitignore ├── LICENSE ├── comocma-apidocs ├── apidocs.css ├── bootstrap.min.css ├── classIndex.html ├── comocma.__init__.html ├── comocma.__main__.html ├── comocma.como.CmaKernel.html ├── comocma.como.FitFun.html ├── comocma.como.IndicatorFront.html ├── comocma.como.Sofomore.html ├── comocma.como.html ├── comocma.html ├── comocma.hv.HyperVolume.html ├── comocma.hv.MultiList.Node.html ├── comocma.hv.MultiList.html ├── comocma.hv.html ├── comocma.nondominatedarchive.NonDominatedList.html ├── comocma.nondominatedarchive.html ├── comocma.sofomore_logger.SofomoreDataLogger.html ├── comocma.sofomore_logger.html ├── index.html ├── moduleIndex.html ├── nameIndex.html ├── objects.inv ├── pydoctor.js └── undoccedSummary.html ├── comocma-epydocs ├── api-objects.txt ├── class-tree.html ├── comocma-module.html ├── comocma-pysrc.html ├── comocma.__main__-module.html ├── comocma.__main__-pysrc.html ├── comocma.como-module.html ├── comocma.como-pysrc.html ├── comocma.como.CmaKernel-class.html ├── comocma.como.FitFun-class.html ├── comocma.como.IndicatorFront-class.html ├── comocma.como.Sofomore-class.html ├── comocma.hv-module.html ├── comocma.hv-pysrc.html ├── comocma.hv.HyperVolume-class.html ├── comocma.hv.MultiList-class.html ├── comocma.hv.MultiList.Node-class.html ├── comocma.nondominatedarchive-module.html ├── comocma.nondominatedarchive-pysrc.html ├── comocma.nondominatedarchive.NonDominatedList-class.html ├── comocma.sofomore_logger-module.html ├── comocma.sofomore_logger-pysrc.html ├── comocma.sofomore_logger.SofomoreDataLogger-class.html ├── crarr.png ├── epydoc.css ├── epydoc.js ├── frames.html ├── help.html ├── identifier-index.html ├── index.html ├── module-tree.html ├── redirect.html ├── toc-comocma-module.html ├── toc-comocma.__main__-module.html ├── toc-comocma.como-module.html ├── toc-comocma.hv-module.html ├── toc-comocma.nondominatedarchive-module.html ├── toc-comocma.sofomore_logger-module.html ├── toc-everything.html └── toc.html ├── comocma ├── LICENSE ├── __init__.py ├── __main__.py ├── como.py ├── hv.py ├── nondominatedarchive.py └── sofomore_logger.py ├── index.html ├── readme.md ├── readme.txt ├── readme_images ├── cma-example.png ├── divers.png └── front.png └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | comocma/.DS_Store 4 | *.dat 5 | *.aux *.log 6 | *.out *.synctex.gz 7 | .ipynb_checkpoints 8 | __pycache__ 9 | cma_kernels 10 | outsofomore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The BSD 3-Clause License 2 | Copyright (c) 2019 Inria 3 | Authors: Cheikh Toure and Nikolaus Hansen, 2019 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright and 10 | authors notice, this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | and authors notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided with 15 | the distribution. 16 | 17 | 3. Neither the name of the copyright holder nor the names of its 18 | contributors nor the authors names may be used to endorse or promote 19 | products derived from this software without specific prior written 20 | permission. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES 26 | OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 27 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 28 | DEALINGS IN THE SOFTWARE. 29 | -------------------------------------------------------------------------------- /comocma-apidocs/apidocs.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | margin-bottom: 0px; 3 | } 4 | 5 | .page-header { 6 | margin-top: 22px; 7 | } 8 | 9 | 10 | ul { 11 | margin-top: 10px; 12 | padding-left: 10px; 13 | list-style-type: none; 14 | } 15 | 16 | li { 17 | padding-top: 5px; 18 | padding-bottom: 5px; 19 | } 20 | 21 | li a { 22 | text-decoration: none; 23 | } 24 | 25 | ul { 26 | margin-left: 10px; 27 | } 28 | 29 | ul ul { 30 | border-left-color: #e1f5fe; 31 | border-left-width: 1px; 32 | border-left-style: solid; 33 | } 34 | 35 | ul ul ul { 36 | border-left-color: #b3e5fc; 37 | } 38 | 39 | ul ul ul ul { 40 | border-left-color: #81d4fa; 41 | } 42 | 43 | ul ul ul ul ul { 44 | border-left-color: #4fc3f7; 45 | } 46 | 47 | ul ul ul ul ul ul { 48 | border-left-color: #29b6f6; 49 | } 50 | 51 | ul ul ul ul ul ul ul { 52 | border-left-color: #03a9f4; 53 | } 54 | 55 | ul ul ul ul ul ul ul { 56 | border-left-color: #039be5; 57 | } 58 | 59 | .undocumented { 60 | font-style: italic; 61 | color: #9e9e9e; 62 | } 63 | 64 | .functionBody p { 65 | margin-top: 6px; 66 | margin-bottom: 6px; 67 | } 68 | 69 | #splitTables > p { 70 | margin-bottom: 5px; 71 | } 72 | 73 | #splitTables > table, .fieldTable { 74 | margin-bottom: 20px; 75 | width: 100%; 76 | border: 0; 77 | } 78 | 79 | #splitTables > table { 80 | border: 1px solid #eee; 81 | } 82 | 83 | #splitTables > table tr { 84 | border-bottom-color: #eee; 85 | border-bottom-width: 1px; 86 | border-bottom-style: solid; 87 | } 88 | 89 | #splitTables > table tr td, .fieldTable tr td { 90 | padding: 5px; 91 | } 92 | 93 | #splitTables > table tr td { 94 | border-left-color: #eee; 95 | border-left-width: 1px; 96 | border-left-style: solid; 97 | } 98 | 99 | #splitTables > table tr td:nth-child(1), .fieldTable tr td:nth-child(1) { 100 | border-left: none; 101 | width: 150px; 102 | } 103 | 104 | #splitTables > table tr td:nth-child(2), .fieldTable tr td.fieldArg { 105 | font-family: Menlo,Monaco,Consolas,"Courier New",monospace; 106 | width: 200px; 107 | } 108 | 109 | tr.package { 110 | background-color: #fff3e0; 111 | } 112 | 113 | tr.module { 114 | background-color: #fff8e1; 115 | } 116 | 117 | tr.class { 118 | background-color: #fffde7; 119 | } 120 | 121 | tr.instancevariable, tr.variable, tr.baseclassvariable, tr.attribute { 122 | background-color: #f3e5f5; 123 | } 124 | 125 | tr.interface { 126 | background-color: #fbe9e7; 127 | } 128 | 129 | tr.method, tr.function, tr.basemethod, tr.baseclassmethod, tr.classmethod { 130 | background-color: #f1f8e9; 131 | } 132 | 133 | tr.private { 134 | background-color: #f1f1f1; 135 | } 136 | 137 | .fieldTable { 138 | margin-top: 10px; 139 | } 140 | 141 | 142 | #childList > div { 143 | margin: 20px; 144 | padding: 15px; 145 | padding-bottom: 5px; 146 | } 147 | 148 | .functionBody { 149 | margin-left: 15px; 150 | } 151 | 152 | .functionBody > #part { 153 | font-style: italic; 154 | } 155 | 156 | .functionBody > #part > a { 157 | text-decoration: none; 158 | } 159 | 160 | .functionBody .interfaceinfo { 161 | font-style: italic; 162 | margin-bottom: 3px; 163 | } 164 | 165 | .functionBody > .undocumented { 166 | 167 | margin-top: 6px; 168 | margin-bottom: 6px; 169 | } 170 | 171 | .code { 172 | font-family: Menlo,Monaco,Consolas,"Courier New",monospace; 173 | padding:2px 4px; 174 | font-size:90%; 175 | color:#c7254e; 176 | background-color:#f9f2f4; 177 | border-radius:4px 178 | } 179 | 180 | code > .code { 181 | padding: 0px; 182 | } 183 | 184 | 185 | #childList > div { 186 | border-left-color: #03a9f4; 187 | border-left-width: 1px; 188 | border-left-style: solid; 189 | } 190 | 191 | #childList > div .functionHeader { 192 | font-family: monospace; 193 | } 194 | 195 | .moduleDocstring { 196 | margin: 20px; 197 | } 198 | 199 | #partOf { 200 | margin-top: -13px; 201 | margin-bottom: 19px; 202 | } 203 | 204 | .fromInitPy { 205 | font-style: italic; 206 | } 207 | 208 | pre { 209 | padding-left: 0px; 210 | } 211 | 212 | /* Private stuff */ 213 | 214 | body.private-hidden #splitTables .private, body.private-hidden #childList .private { 215 | display: none; 216 | } 217 | 218 | #showPrivate { 219 | position: fixed; 220 | bottom: 0; 221 | left: 0; 222 | padding: 10px; 223 | opacity: 0.7; 224 | } 225 | 226 | #showPrivate:hover { 227 | opacity: 1; 228 | } 229 | 230 | #current-docs-container { 231 | font-style: italic; 232 | padding-top: 11px; 233 | } 234 | 235 | /* Deprecation stuff */ 236 | 237 | .deprecationNotice { 238 | margin: 10px; 239 | } 240 | -------------------------------------------------------------------------------- /comocma-apidocs/classIndex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 22 | 23 |
24 | 25 | 28 | 29 | 31 | 32 |
33 | 34 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.__init__.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.__init__ : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
This module contains the implementation of the Multiobjective framework called
46 | Sofomore, and its instantiation with cma-es to obtain COMO-CMA-ES, defined in 
47 | the paper [Toure, Cheikh, et al. "Uncrowded Hypervolume Improvement: 
48 |         COMO-CMA-ES and the Sofomore framework." 
49 |         GECCO'19-Genetic and Evolutionary Computation Conference. 2019.].
50 | 
51 | Only the bi-objective framework is functional and has been thoroughly tested.
52 | 
53 | 
54 | :Author: Cheikh Toure and Nikolaus Hansen, 2019
55 | 
56 | :License: BSD 3-Clause, see LICENSE file.
57 |
58 | 59 |
60 | 61 | 62 | 63 | 64 |
65 | 66 |
67 | 68 | 69 | 70 |
71 |
72 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 73 |
74 | 75 |
76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.__main__.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.__main__ : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
Undocumented
46 |
47 | 48 |
49 | 50 | 51 | 52 | 53 |
54 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 62 |
63 | 64 |
65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.como.CmaKernel.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.como.CmaKernel : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
inheriting from the cma.CMAEvolutionStrategy class, by adding the property 46 | incumbent, the attributes objective_values and _last_offspring_f_values.
47 |
48 | 49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
Method__init__No summary
Methodincumbentit gives the 'repaired' mean of a cma-es. For a problem with bound constraints, self.incumbent in inside the bounds.
Method_copy_lighttentative copy of self, versatile (interface and functionalities may change).
69 | 70 | 71 | 72 |
73 | 74 |
75 | 76 |
77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 |
85 | 86 | def 87 | __init__(self, x0, sigma0, inopts=None): 88 | 89 |
90 |
91 | 92 | 93 |
94 |
x0
95 |

initial solution, starting point. x0 is given as "phenotype" 96 | which means, if:

97 |
 98 | opts = {'transformation': [transform, inverse]}
 99 | 
100 |

is given and inverse is None, the initial mean is not 101 | consistent with x0 in that transform(mean) does not 102 | equal to x0 unless transform(mean) equals mean.

103 |
104 |
sigma0
105 |
initial standard deviation. The problem variables should 106 | have been scaled, such that a single standard deviation 107 | on all variables is useful and the optimum is expected to 108 | lie within about x0 +- 3*sigma0. See also options 109 | scaling_of_variables. Often one wants to check for 110 | solutions close to the initial point. This allows, 111 | for example, for an easier check of consistency of the 112 | objective function and its interfacing with the optimizer. 113 | In this case, a much smaller sigma0 is advisable.
114 |
inopts
115 |
options, a dictionary with optional settings, 116 | see class cma.CMAOptions.
117 |
118 |
119 |
120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 |
128 | @property
129 | def 130 | incumbent(self): 131 | 132 |
133 |
134 | 135 | 136 |
it gives the 'repaired' mean of a cma-es. For a problem with bound 137 | constraints, self.incumbent in inside the bounds.
138 |
139 |
140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 |
148 | 149 | def 150 | _copy_light(self, sigma=None, inopts=None): 151 | 152 |
153 |
154 | 155 | 156 |

tentative copy of self, versatile (interface and functionalities may change).

157 |

This may not work depending on the used sampler.

158 |

Copy mean and sample distribution parameters and input options.

159 |

Do not copy evolution paths, termination status or other state variables.

160 |
161 |
162 | 163 |
164 |
165 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 166 |
167 | 168 |
169 | 170 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.como.FitFun.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.como.FitFun : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
Define a callable multiobjective function from single objective ones.
 46 | Example:
 47 |     fitness = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)).
48 |
49 | 50 |
51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
Method__init__Undocumented
Method__call__Undocumented
65 | 66 | 67 | 68 |
69 | 70 |
71 | 72 |
73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
81 | 82 | def 83 | __init__(self, *args): 84 | 85 |
86 |
87 | 88 | 89 |
Undocumented
90 |
91 |
92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |
100 | 101 | def 102 | __call__(self, x): 103 | 104 |
105 |
106 | 107 | 108 |
Undocumented
109 |
110 |
111 | 112 |
113 |
114 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 115 |
116 | 117 |
118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.como.IndicatorFront.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.como.IndicatorFront : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
with `hypervolume_improvement` method based on a varying empirical front.
 46 | 
 47 | The front is either all kernels but one or based on the
 48 | `list_attribute` of `moes` (like `archive`) as given on
 49 | initialization.
 50 | 
 51 | Usage::
 52 |     >>> import comocma, cma
 53 |     >>> list_of_solvers_instances = comocma.get_cmas(13 * [5 * [0.4]], 0.7, {'verbose':-9})
 54 |     >>> fitness = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1))
 55 |     >>> moes = comocma.Sofomore(list_of_solvers_instances, [11, 11])
 56 |     >>> moes.front_observed = IndicatorFront()
 57 |     >>> moes.optimize(fitness, iterations=47) # doctest:+ELLIPSIS
 58 |     Iterat #Fevals   Hypervolume   axis ratios   sigmas   min&max stds***
 59 |     >>> moes = comocma.Sofomore(list_of_solvers_instances, [11, 11])
 60 |     >>> moes.front_observed = IndicatorFront(list_attribute='archive')
 61 |     >>> moes.optimize(fitness, iterations=37) # doctest:+ELLIPSIS
 62 |     Iterat #Fevals   Hypervolume   axis ratios   sigmas   min&max stds***
 63 |     >>> moes.front_observed.set_kernel(moes[3], moes)
 64 |     >>> f_points = [moes.front_observed.hypervolume_improvement(point)
 65 |     ...             for point in moes[3]._last_offspring_f_values] 
66 |
67 | 68 |
69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
Method__init__getattr(moes, list_attribute) contains the list to create the front.
Methodhypervolume_improvementUndocumented
Methodset_kernelSet empirical front for evolving the given kernel.
88 | 89 | 90 | 91 |
92 | 93 |
94 | 95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 |
104 | 105 | def 106 | __init__(self, list_attribute=None, NDA=None): 107 | 108 |
109 |
110 | 111 | 112 |

getattr(moes, list_attribute) contains the list to create the front.

113 |

NDA is a non-dominated archive with a hypervolume_improvement method.

114 |
115 |
116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 |
124 | 125 | def 126 | hypervolume_improvement(self, point): 127 | 128 |
129 |
130 | 131 | 132 |
Undocumented
133 |
134 |
135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 |
143 | 144 | def 145 | set_kernel(self, kernel, moes, lazy=True): 146 | 147 |
148 |
149 | 150 | 151 |

Set empirical front for evolving the given kernel.

152 |

By default, make changes only when kernel has changed.

153 |

Details: moes.reference_point and, in case, its attribute 154 | with name self.list_attribute: str is used.

155 |
156 |
157 | 158 |
159 |
160 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 161 |
162 | 163 |
164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.como.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.como : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
This module contains the implementation of the Multiobjective framework called
 46 | Sofomore, and its instantiation with cma-es to obtain COMO-CMA-ES, defined in 
 47 | the paper [Toure, Cheikh, et al. "Uncrowded Hypervolume Improvement: 
 48 |         COMO-CMA-ES and the Sofomore framework." 
 49 |         GECCO'19-Genetic and Evolutionary Computation Conference. 2019.].
 50 | 
 51 | Only the bi-objective framework is functional and has been thoroughly tested.
52 |
53 | 54 |
55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 |
ClassSofomoreNo summary
ClassIndicatorFrontwith hypervolume_improvement method based on a varying empirical front.
Functionget_cmasFactory function that produces len(x_starts) instances of type cmaKernel.
ClassCmaKernelinheriting from the cma.CMAEvolutionStrategy class, by adding the property incumbent, the attributes objective_values and _last_offspring_f_values.
ClassFitFunDefine a callable multiobjective function from single objective ones. Example: fitness = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)).
Functionsort_randomNo summary
Functionsort_increasingNo summary
Functionsort_decreasingNo summary
Functionsort_even_oddsNo summary
Functionsort_odds_evenNo summary
109 | 110 | 111 | 112 |
113 | 114 |
115 | 116 |
117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 |
125 | 126 | def 127 | get_cmas(x_starts, sigma_starts, inopts=None, number_created_kernels=0): 128 | 129 |
130 |
131 | 132 | 133 |
Factory function that produces `len(x_starts)` instances of type `cmaKernel`.
134 | 
135 | Parameters
136 | ----------
137 | x_starts : TYPE list or list of lists or list of or ndarrays or ndarray
138 |     The initial means of the returned cmas.
139 | sigma_starts : TYPE float or list of floats
140 |     The initial step-sizes of the returned cmas.
141 | inopts : TYPE dict or list of dicts, optional
142 |     The cmas' options.
143 | number_created_kernels : TYPE int, optional
144 |     Used as the starting index for the returned cma's names.
145 |     The values of the options' key 'verb_filenameprefix' rely upon this
146 |     argument `number_created_kernels`.
147 | 
148 | Returns
149 | -------
150 | A list of `CmaKernel` instances.
151 | 
152 | Example::
153 |     >>> import comocma
154 |     >>> dimension = 10
155 |     >>> sigma0 = 0.5
156 |     >>> num_kernels = 11
157 |     >>> cma_opts = {'tolx': 10**-4, 'popsize': 32}
158 |     >>> list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], sigma0, cma_opts) 
159 |     
160 |     produce `num_kernels` cma instances.
161 |
162 |
163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 |
171 | 172 | def 173 | sort_random(i): 174 | 175 |
176 |
177 | 178 | 179 |
Used for the update order of a Sofomore instance.
180 | Example::
181 |     moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_random})
182 | randomly picks the kernels to update in the `tell` method of Sofomore.
183 |
184 |
185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 |
193 | 194 | def 195 | sort_increasing(i): 196 | 197 |
198 |
199 | 200 | 201 |
Example::
202 |     moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_increasing})
203 | updates respectively `self[0]`, `self[1]`, ..., `self[-1]` 
204 | in the `tell` method of Sofomore.
205 |
206 |
207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 |
215 | 216 | def 217 | sort_decreasing(i): 218 | 219 |
220 |
221 | 222 | 223 |
Example::
224 |     moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_decreasing})
225 | updates respectively `self[-1]`, `self[-2]`, ..., `self[0]`
226 | in the `tell` method of Sofomore.
227 |
228 |
229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 |
237 | 238 | def 239 | sort_even_odds(i): 240 | 241 |
242 |
243 | 244 | 245 |
Example::
246 |     moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_even_odds})
247 | pick the kernels with even indices before the kernels with odd indices in
248 | the `tell` method of Sofomore.
249 |
250 |
251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 |
259 | 260 | def 261 | sort_odds_even(i): 262 | 263 |
264 |
265 | 266 | 267 |
Example::
268 |     moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_odds_even})
269 | pick the kernels with odd indices before the kernels with even indices 
270 | in the `tell` method of Sofomore.
271 |
272 |
273 | 274 |
275 |
276 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 277 |
278 | 279 |
280 | 281 | 282 | 283 | 284 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
This module contains the implementation of the Multiobjective framework called
 46 | Sofomore, and its instantiation with cma-es to obtain COMO-CMA-ES, defined in 
 47 | the paper [Toure, Cheikh, et al. "Uncrowded Hypervolume Improvement: 
 48 |         COMO-CMA-ES and the Sofomore framework." 
 49 |         GECCO'19-Genetic and Evolutionary Computation Conference. 2019.].
 50 | 
 51 | Only the bi-objective framework is functional and has been thoroughly tested.
 52 | 
 53 | 
 54 | :Author: Cheikh Toure and Nikolaus Hansen, 2019
 55 | 
 56 | :License: BSD 3-Clause, see LICENSE file.
57 |
58 | 59 |
60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
Module__main__Undocumented
ModulecomoNo summary
ModulehvNo module docstring; 2/2 classes documented
ModulenondominatedarchiveNo module docstring; 1/1 classes documented
Modulesofomore_loggerNo module docstring; 1/1 classes documented
89 | 90 | 91 | 92 |
93 | 94 |
95 | 96 | 97 | 98 |
99 |
100 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 101 |
102 | 103 |
104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.hv.HyperVolume.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.hv.HyperVolume : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |

Hypervolume computation based on variant 3 of the algorithm in the paper: 46 | C. M. Fonseca, L. Paquete, and M. Lopez-Ibanez. An improved dimension-sweep 47 | algorithm for the hypervolume indicator. In IEEE Congress on Evolutionary 48 | Computation, pages 1157-1163, Vancouver, Canada, July 2006.

49 |

Minimization is implicitly assumed here!

50 |
51 | 52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 |
Method__init__Constructor.
MethodcomputeReturns the hypervolume that is dominated by a non-dominated front.
MethodhvRecursiveRecursive call to hypervolume calculation.
MethodpreProcessSets up the list data structure needed for calculation.
MethodsortByDimensionSorts the list of nodes by the i-th value of the contained points.
82 | 83 | 84 | 85 |
86 | 87 |
88 | 89 |
90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
98 | 99 | def 100 | __init__(self, referencePoint): 101 | 102 |
103 |
104 | 105 | 106 |
Constructor.
107 |
108 |
109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 |
117 | 118 | def 119 | compute(self, front): 120 | 121 |
122 |
123 | 124 | 125 |

Returns the hypervolume that is dominated by a non-dominated front.

126 |

Before the HV computation, front and reference point are translated, so 127 | that the reference point is [0, ..., 0].

128 |
129 |
130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 |
138 | 139 | def 140 | hvRecursive(self, dimIndex, length, bounds): 141 | 142 |
143 |
144 | 145 | 146 |

Recursive call to hypervolume calculation.

147 |

In contrast to the paper, the code assumes that the reference point 148 | is [0, ..., 0]. This allows the avoidance of a few operations.

149 |
150 |
151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 |
159 | 160 | def 161 | preProcess(self, front): 162 | 163 |
164 |
165 | 166 | 167 |
Sets up the list data structure needed for calculation.
168 |
169 |
170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 |
178 | 179 | def 180 | sortByDimension(self, nodes, i): 181 | 182 |
183 |
184 | 185 | 186 |
Sorts the list of nodes by the i-th value of the contained points.
187 |
188 |
189 | 190 |
191 |
192 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 193 |
194 | 195 |
196 | 197 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.hv.MultiList.Node.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.hv.MultiList.Node : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
Undocumented
46 |
47 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
Method__init__Undocumented
Method__str__Undocumented
63 | 64 | 65 | 66 |
67 | 68 |
69 | 70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |
79 | 80 | def 81 | __init__(self, numberLists, cargo=None): 82 | 83 |
84 |
85 | 86 | 87 |
Undocumented
88 |
89 |
90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
98 | 99 | def 100 | __str__(self): 101 | 102 |
103 |
104 | 105 | 106 |
Undocumented
107 |
108 |
109 | 110 |
111 |
112 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 113 |
114 | 115 |
116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.hv.MultiList.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.hv.MultiList : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |

A special data structure needed by FonsecaHyperVolume.

46 |

It consists of several doubly linked lists that share common nodes. So, 47 | every node has multiple predecessors and successors, one in every list.

48 |
49 | 50 |
51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |
ClassNodeUndocumented
Method__init__Constructor.
Method__str__Undocumented
Method__len__Returns the number of lists that are included in this MultiList.
MethodgetLengthReturns the length of the i-th list.
MethodappendAppends a node to the end of the list at the given index.
MethodextendExtends the list at the given index with the nodes.
MethodremoveRemoves and returns 'node' from all lists in [0, 'index'[.
MethodreinsertInserts 'node' at the position it had in all lists in [0, 'index'[ before it was removed. This method assumes that the next and previous nodes of the node that is reinserted are in the list.
100 | 101 | 102 | 103 |
104 | 105 |
106 | 107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 |
116 | 117 | def 118 | __init__(self, numberLists): 119 | 120 |
121 |
122 | 123 | 124 |

Constructor.

125 |

Builds 'numberLists' doubly linked lists.

126 |
127 |
128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 |
136 | 137 | def 138 | __str__(self): 139 | 140 |
141 |
142 | 143 | 144 |
Undocumented
145 |
146 |
147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 |
155 | 156 | def 157 | __len__(self): 158 | 159 |
160 |
161 | 162 | 163 |
Returns the number of lists that are included in this MultiList.
164 |
165 |
166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 |
174 | 175 | def 176 | getLength(self, i): 177 | 178 |
179 |
180 | 181 | 182 |
Returns the length of the i-th list.
183 |
184 |
185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 |
193 | 194 | def 195 | append(self, node, index): 196 | 197 |
198 |
199 | 200 | 201 |
Appends a node to the end of the list at the given index.
202 |
203 |
204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 |
212 | 213 | def 214 | extend(self, nodes, index): 215 | 216 |
217 |
218 | 219 | 220 |
Extends the list at the given index with the nodes.
221 |
222 |
223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 |
231 | 232 | def 233 | remove(self, node, index, bounds): 234 | 235 |
236 |
237 | 238 | 239 |
Removes and returns 'node' from all lists in [0, 'index'[.
240 |
241 |
242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 |
250 | 251 | def 252 | reinsert(self, node, index, bounds): 253 | 254 |
255 |
256 | 257 | 258 |
Inserts 'node' at the position it had in all lists in [0, 'index'[ 259 | before it was removed. This method assumes that the next and previous 260 | nodes of the node that is reinserted are in the list.
261 |
262 |
263 | 264 |
265 |
266 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 267 |
268 | 269 |
270 | 271 | 272 | 273 | 274 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.hv.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.hv : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
No module docstring
46 |
47 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
ClassHyperVolumeNo summary
ClassMultiListA special data structure needed by FonsecaHyperVolume.
63 | 64 | 65 | 66 |
67 | 68 |
69 | 70 | 71 | 72 |
73 |
74 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 75 |
76 | 77 |
78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.nondominatedarchive.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.nondominatedarchive : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
No module docstring
46 |
47 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
ClassNonDominatedListA list of objective values in an empirical Pareto front, meaning that no point strictly domminates another one in all objectives.
58 | 59 | 60 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 |
69 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 70 |
71 | 72 |
73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /comocma-apidocs/comocma.sofomore_logger.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.sofomore_logger : API documentation 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 |
25 | 26 |
27 | 28 |
29 | 30 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
No module docstring
46 |
47 | 48 |
49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
ClassSofomoreDataLoggerdata logger for class CMAEvolutionStrategy.
58 | 59 | 60 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 |
69 | API Documentation for comocma, generated by pydoctor at 2020-04-18 16:47:06. 70 |
71 | 72 |
73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /comocma-apidocs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | API Documentation for 8 | comocma 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 26 | 27 |
28 |

29 | Get Started 30 |

31 | 49 |

50 | About 51 |

52 |

53 | This documentation was automatically generated by 54 | pydoctor 55 | at 2020-04-18 16:47:06. 56 |

57 | 58 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /comocma-apidocs/moduleIndex.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Module Index 7 | 8 | 9 | 10 | 11 | 12 | 22 | 23 |
24 | 25 | 28 | 29 | 30 | 31 |
32 | 33 | -------------------------------------------------------------------------------- /comocma-apidocs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CMA-ES/pycomocma/709dc6ff83acfe4f312f04ec2d4bc6daefecff95/comocma-apidocs/objects.inv -------------------------------------------------------------------------------- /comocma-apidocs/pydoctor.js: -------------------------------------------------------------------------------- 1 | function togglePrivate() { 2 | // Hide all private things by adding the private-hidden class to them. 3 | document.body.classList.toggle("private-hidden"); 4 | 5 | var button = document.querySelector('#showPrivate button'); 6 | if(document.body.classList.contains('private-hidden')) { 7 | button.innerText = 'Show Private API'; 8 | } else { 9 | button.innerText = 'Hide Private API'; 10 | } 11 | } 12 | // On load, hide everything private 13 | togglePrivate() 14 | -------------------------------------------------------------------------------- /comocma-apidocs/undoccedSummary.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Summary of Undocumented Objects 7 | 8 | 9 | 10 | 11 | 12 | 22 | 23 |
24 | 25 | 28 | 29 | 31 | 32 |
33 | 34 | -------------------------------------------------------------------------------- /comocma-epydocs/api-objects.txt: -------------------------------------------------------------------------------- 1 | comocma comocma-module.html 2 | comocma.__package__ comocma-module.html#__package__ 3 | comocma.__main__ comocma.__main__-module.html 4 | comocma.__main__.__package__ comocma.__main__-module.html#__package__ 5 | comocma.como comocma.como-module.html 6 | comocma.como.sort_random comocma.como-module.html#sort_random 7 | comocma.como.sort_odds_even comocma.como-module.html#sort_odds_even 8 | comocma.como.sort_increasing comocma.como-module.html#sort_increasing 9 | comocma.como.get_cmas comocma.como-module.html#get_cmas 10 | comocma.como.__package__ comocma.como-module.html#__package__ 11 | comocma.como.sort_decreasing comocma.como-module.html#sort_decreasing 12 | comocma.como.cma_kernel_default_options_replacements comocma.como-module.html#cma_kernel_default_options_replacements 13 | comocma.como.sort_even_odds comocma.como-module.html#sort_even_odds 14 | comocma.hv comocma.hv-module.html 15 | comocma.hv.__package__ comocma.hv-module.html#__package__ 16 | comocma.nondominatedarchive comocma.nondominatedarchive-module.html 17 | comocma.nondominatedarchive.__package__ comocma.nondominatedarchive-module.html#__package__ 18 | comocma.sofomore_logger comocma.sofomore_logger-module.html 19 | comocma.sofomore_logger.__package__ comocma.sofomore_logger-module.html#__package__ 20 | comocma.como.CmaKernel comocma.como.CmaKernel-class.html 21 | comocma.como.CmaKernel.__init__ comocma.como.CmaKernel-class.html#__init__ 22 | comocma.como.CmaKernel.incumbent comocma.como.CmaKernel-class.html#incumbent 23 | comocma.como.CmaKernel._copy_light comocma.como.CmaKernel-class.html#_copy_light 24 | comocma.como.FitFun comocma.como.FitFun-class.html 25 | comocma.como.FitFun.__call__ comocma.como.FitFun-class.html#__call__ 26 | comocma.como.FitFun.__init__ comocma.como.FitFun-class.html#__init__ 27 | comocma.como.IndicatorFront comocma.como.IndicatorFront-class.html 28 | comocma.como.IndicatorFront.set_kernel comocma.como.IndicatorFront-class.html#set_kernel 29 | comocma.como.IndicatorFront.hypervolume_improvement comocma.como.IndicatorFront-class.html#hypervolume_improvement 30 | comocma.como.IndicatorFront.__init__ comocma.como.IndicatorFront-class.html#__init__ 31 | comocma.como.Sofomore comocma.como.Sofomore-class.html 32 | comocma.como.Sofomore.median_stds comocma.como.Sofomore-class.html#median_stds 33 | comocma.como.Sofomore.disp comocma.como.Sofomore-class.html#disp 34 | comocma.como.Sofomore.activate comocma.como.Sofomore-class.html#activate 35 | comocma.como.Sofomore.max_max_stds comocma.como.Sofomore-class.html#max_max_stds 36 | comocma.como.Sofomore.inactivate comocma.como.Sofomore-class.html#inactivate 37 | comocma.como.Sofomore.__init__ comocma.como.Sofomore-class.html#__init__ 38 | comocma.como.Sofomore._indices_to_ask comocma.como.Sofomore-class.html#_indices_to_ask 39 | comocma.como.Sofomore.termination_status comocma.como.Sofomore-class.html#termination_status 40 | comocma.como.Sofomore.add comocma.como.Sofomore-class.html#add 41 | comocma.como.Sofomore.tell comocma.como.Sofomore-class.html#tell 42 | comocma.como.Sofomore.__len__ comocma.como.Sofomore-class.html#__len__ 43 | comocma.como.Sofomore.__getitem__ comocma.como.Sofomore-class.html#__getitem__ 44 | comocma.como.Sofomore.stop comocma.como.Sofomore-class.html#stop 45 | comocma.como.Sofomore.pareto_front_cut comocma.como.Sofomore-class.html#pareto_front_cut 46 | comocma.como.Sofomore.__iter__ comocma.como.Sofomore-class.html#__iter__ 47 | comocma.como.Sofomore.ask comocma.como.Sofomore-class.html#ask 48 | comocma.como.Sofomore.sorted comocma.como.Sofomore-class.html#sorted 49 | comocma.como.Sofomore.disp_annotation comocma.como.Sofomore-class.html#disp_annotation 50 | comocma.como.Sofomore.pareto_front_uncut comocma.como.Sofomore-class.html#pareto_front_uncut 51 | comocma.como.Sofomore._UHVI_indicator comocma.como.Sofomore-class.html#_UHVI_indicator 52 | comocma.como.Sofomore.remove comocma.como.Sofomore-class.html#remove 53 | comocma.como.Sofomore.pareto_set_cut comocma.como.Sofomore-class.html#pareto_set_cut 54 | comocma.como.Sofomore._UHVI_indicator_archive comocma.como.Sofomore-class.html#_UHVI_indicator_archive 55 | comocma.hv.HyperVolume comocma.hv.HyperVolume-class.html 56 | comocma.hv.HyperVolume.preProcess comocma.hv.HyperVolume-class.html#preProcess 57 | comocma.hv.HyperVolume.hvRecursive comocma.hv.HyperVolume-class.html#hvRecursive 58 | comocma.hv.HyperVolume.sortByDimension comocma.hv.HyperVolume-class.html#sortByDimension 59 | comocma.hv.HyperVolume.compute comocma.hv.HyperVolume-class.html#compute 60 | comocma.hv.HyperVolume.__init__ comocma.hv.HyperVolume-class.html#__init__ 61 | comocma.hv.MultiList comocma.hv.MultiList-class.html 62 | comocma.hv.MultiList.Node comocma.hv.MultiList.Node-class.html 63 | comocma.hv.MultiList.reinsert comocma.hv.MultiList-class.html#reinsert 64 | comocma.hv.MultiList.extend comocma.hv.MultiList-class.html#extend 65 | comocma.hv.MultiList.getLength comocma.hv.MultiList-class.html#getLength 66 | comocma.hv.MultiList.__str__ comocma.hv.MultiList-class.html#__str__ 67 | comocma.hv.MultiList.remove comocma.hv.MultiList-class.html#remove 68 | comocma.hv.MultiList.__len__ comocma.hv.MultiList-class.html#__len__ 69 | comocma.hv.MultiList.__init__ comocma.hv.MultiList-class.html#__init__ 70 | comocma.hv.MultiList.append comocma.hv.MultiList-class.html#append 71 | comocma.hv.MultiList.Node comocma.hv.MultiList.Node-class.html 72 | comocma.hv.MultiList.Node.__str__ comocma.hv.MultiList.Node-class.html#__str__ 73 | comocma.hv.MultiList.Node.__init__ comocma.hv.MultiList.Node-class.html#__init__ 74 | comocma.nondominatedarchive.NonDominatedList comocma.nondominatedarchive.NonDominatedList-class.html 75 | comocma.nondominatedarchive.NonDominatedList.dominates_with comocma.nondominatedarchive.NonDominatedList-class.html#dominates_with 76 | comocma.nondominatedarchive.NonDominatedList._asserts comocma.nondominatedarchive.NonDominatedList-class.html#_asserts 77 | comocma.nondominatedarchive.NonDominatedList.add_list comocma.nondominatedarchive.NonDominatedList-class.html#add_list 78 | comocma.nondominatedarchive.NonDominatedList.__init__ comocma.nondominatedarchive.NonDominatedList-class.html#__init__ 79 | comocma.nondominatedarchive.NonDominatedList.dominates comocma.nondominatedarchive.NonDominatedList-class.html#dominates 80 | comocma.nondominatedarchive.NonDominatedList.in_domain comocma.nondominatedarchive.NonDominatedList-class.html#in_domain 81 | comocma.nondominatedarchive.NonDominatedList.add comocma.nondominatedarchive.NonDominatedList-class.html#add 82 | comocma.nondominatedarchive.NonDominatedList.distance_to_pareto_front comocma.nondominatedarchive.NonDominatedList-class.html#distance_to_pareto_front 83 | comocma.nondominatedarchive.NonDominatedList.dominates_with_old comocma.nondominatedarchive.NonDominatedList-class.html#dominates_with_old 84 | comocma.nondominatedarchive.NonDominatedList._strictly_dominates_with comocma.nondominatedarchive.NonDominatedList-class.html#_strictly_dominates_with 85 | comocma.nondominatedarchive.NonDominatedList._strictly_dominates comocma.nondominatedarchive.NonDominatedList-class.html#_strictly_dominates 86 | comocma.nondominatedarchive.NonDominatedList.hypervolume comocma.nondominatedarchive.NonDominatedList-class.html#hypervolume 87 | comocma.nondominatedarchive.NonDominatedList.dominates_with_for comocma.nondominatedarchive.NonDominatedList-class.html#dominates_with_for 88 | comocma.nondominatedarchive.NonDominatedList._random_archive_many comocma.nondominatedarchive.NonDominatedList-class.html#_random_archive_many 89 | comocma.nondominatedarchive.NonDominatedList._random_archive comocma.nondominatedarchive.NonDominatedList-class.html#_random_archive 90 | comocma.nondominatedarchive.NonDominatedList.contributing_hypervolume comocma.nondominatedarchive.NonDominatedList-class.html#contributing_hypervolume 91 | comocma.nondominatedarchive.NonDominatedList.prune comocma.nondominatedarchive.NonDominatedList-class.html#prune 92 | comocma.nondominatedarchive.NonDominatedList.hypervolume_improvement comocma.nondominatedarchive.NonDominatedList-class.html#hypervolume_improvement 93 | comocma.nondominatedarchive.NonDominatedList.kink_points comocma.nondominatedarchive.NonDominatedList-class.html#kink_points 94 | comocma.nondominatedarchive.NonDominatedList.remove comocma.nondominatedarchive.NonDominatedList-class.html#remove 95 | comocma.nondominatedarchive.NonDominatedList.dominators comocma.nondominatedarchive.NonDominatedList-class.html#dominators 96 | comocma.nondominatedarchive.NonDominatedList._projection comocma.nondominatedarchive.NonDominatedList-class.html#_projection 97 | comocma.nondominatedarchive.NonDominatedList._projection_to_empirical_front comocma.nondominatedarchive.NonDominatedList-class.html#_projection_to_empirical_front 98 | comocma.sofomore_logger.SofomoreDataLogger comocma.sofomore_logger.SofomoreDataLogger-class.html 99 | comocma.sofomore_logger.SofomoreDataLogger.load comocma.sofomore_logger.SofomoreDataLogger-class.html#load 100 | comocma.sofomore_logger.SofomoreDataLogger.register comocma.sofomore_logger.SofomoreDataLogger-class.html#register 101 | comocma.sofomore_logger.SofomoreDataLogger.modulo comocma.sofomore_logger.SofomoreDataLogger-class.html#modulo 102 | comocma.sofomore_logger.SofomoreDataLogger.append comocma.sofomore_logger.SofomoreDataLogger-class.html#append 103 | comocma.sofomore_logger.SofomoreDataLogger.plot comocma.sofomore_logger.SofomoreDataLogger-class.html#plot 104 | comocma.sofomore_logger.SofomoreDataLogger.plot_stds comocma.sofomore_logger.SofomoreDataLogger-class.html#plot_stds 105 | comocma.sofomore_logger.SofomoreDataLogger.plot_ratios comocma.sofomore_logger.SofomoreDataLogger-class.html#plot_ratios 106 | comocma.sofomore_logger.SofomoreDataLogger.add comocma.sofomore_logger.SofomoreDataLogger-class.html#add 107 | comocma.sofomore_logger.SofomoreDataLogger.__init__ comocma.sofomore_logger.SofomoreDataLogger-class.html#__init__ 108 | comocma.sofomore_logger.SofomoreDataLogger.plot_divers comocma.sofomore_logger.SofomoreDataLogger-class.html#plot_divers 109 | comocma.sofomore_logger.SofomoreDataLogger.default_prefix comocma.sofomore_logger.SofomoreDataLogger-class.html#default_prefix 110 | comocma.sofomore_logger.SofomoreDataLogger.initialize comocma.sofomore_logger.SofomoreDataLogger-class.html#initialize 111 | comocma.sofomore_logger.SofomoreDataLogger._finalize_plotting comocma.sofomore_logger.SofomoreDataLogger-class.html#_finalize_plotting 112 | comocma.sofomore_logger.SofomoreDataLogger._enter_plotting comocma.sofomore_logger.SofomoreDataLogger-class.html#_enter_plotting 113 | comocma.sofomore_logger.SofomoreDataLogger.plot_front comocma.sofomore_logger.SofomoreDataLogger-class.html#plot_front 114 | comocma.sofomore_logger.SofomoreDataLogger._xlabel comocma.sofomore_logger.SofomoreDataLogger-class.html#_xlabel 115 | comocma.sofomore_logger.SofomoreDataLogger.counter comocma.sofomore_logger.SofomoreDataLogger-class.html#counter 116 | -------------------------------------------------------------------------------- /comocma-epydocs/class-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Class Hierarchy 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 50 | 51 |
  40 | 41 | 42 | 44 | 48 |
[hide private]
[frames] | no frames]
49 |
52 |
53 | [ Module Hierarchy 54 | | Class Hierarchy ] 55 |

56 |

Class Hierarchy

57 | 118 | 119 | 121 | 122 | 123 | 125 | 126 | 127 | 129 | 130 | 131 | 133 | 134 | 135 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 146 | 150 | 151 |
152 | 153 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /comocma-epydocs/comocma-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 43 | 54 | 55 |
39 | 40 | Package comocma 41 | 42 | 44 | 45 | 46 | 48 | 52 |
[hide private]
[frames] | no frames]
53 |
56 | 57 |

Package comocma

source code

58 |
 59 | 
 60 | This module contains the implementation of the Multiobjective framework called
 61 | Sofomore, and its instantiation with cma-es to obtain COMO-CMA-ES, defined in 
 62 | the paper [Toure, Cheikh, et al. "Uncrowded Hypervolume Improvement: 
 63 |         COMO-CMA-ES and the Sofomore framework." 
 64 |         GECCO'19-Genetic and Evolutionary Computation Conference. 2019.].
 65 | 
 66 | Only the bi-objective framework is functional and has been thoroughly tested.
 67 | 
 68 | 
 69 | :Author: Cheikh Toure and Nikolaus Hansen, 2019
 70 | 
 71 | :License: BSD 3-Clause, see LICENSE file.
 72 | 
 73 | 
74 | 75 |
76 |

Version: 77 | 0.5.1 78 |

79 |

Author: 80 | Cheikh Toure and Nikolaus Hansen 81 |

82 |

License: 83 | BSD 3-clause 84 |

85 |
86 | 87 | 89 | 90 | 101 | 102 | 112 |
91 | 92 | 93 | 94 | 98 | 99 |
Submodules[hide private]
100 |
103 |
113 | 114 |
115 | 116 | 117 | 119 | 120 | 131 | 132 | 133 | 138 | 139 |
121 | 122 | 123 | 124 | 128 | 129 |
Variables[hide private]
130 |
134 |   135 | 136 | __package__ = 'comocma' 137 |
140 | 141 | 143 | 144 | 145 | 147 | 148 | 149 | 151 | 152 | 153 | 155 | 156 | 157 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 168 | 172 | 173 |
174 | 175 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /comocma-epydocs/comocma.__main__-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.__main__ 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 44 | 55 | 56 |
39 | 40 | Package comocma :: 41 | Module __main__ 42 | 43 | 45 | 46 | 47 | 49 | 53 |
[hide private]
[frames] | no frames]
54 |
57 | 58 |

Module __main__

source code

59 | 60 | 61 | 63 | 64 | 75 | 76 | 77 | 82 | 83 |
65 | 66 | 67 | 68 | 72 | 73 |
Variables[hide private]
74 |
78 |   79 | 80 | __package__ = 'comocma' 81 |
84 | 85 | 87 | 88 | 89 | 91 | 92 | 93 | 95 | 96 | 97 | 99 | 100 | 101 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 112 | 116 | 117 |
118 | 119 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /comocma-epydocs/comocma.__main__-pysrc.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.__main__ 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 44 | 55 | 56 |
39 | 40 | Package comocma :: 41 | Module __main__ 42 | 43 | 45 | 46 | 47 | 49 | 53 |
[hide private]
[frames] | no frames]
54 |
57 |

Source Code for Module comocma.__main__

58 |
 59 | 1  import doctest 
 60 | 2  import comocma 
 61 | 3   
 62 | 4  doctest.ELLIPSIS_MARKER = '***' # to be able to ignore an entire output,  
 63 | 5      # putting the default '...' doesn't work for that. 
 64 | 6  print('doctesting `comocma`') 
 65 | 7  print(doctest.testmod(comocma.como)) 
 66 | 8   
 71 | 
72 |
73 | 74 | 76 | 77 | 78 | 80 | 81 | 82 | 84 | 85 | 86 | 88 | 89 | 90 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 101 | 105 | 106 |
107 | 108 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /comocma-epydocs/comocma.como.FitFun-class.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.como.FitFun 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 45 | 56 | 57 |
39 | 40 | Package comocma :: 41 | Module como :: 42 | Class FitFun 43 | 44 | 46 | 47 | 48 | 50 | 54 |
[hide private]
[frames] | no frames]
55 |
58 | 59 |

Class FitFun

source code

60 |
 61 | 
 62 | Define a callable multiobjective function from single objective ones.
 63 | Example:
 64 |     fitness = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)).
 65 | 
 66 | 
67 | 68 | 69 | 70 | 72 | 73 | 84 | 85 | 86 | 101 | 102 | 103 | 118 | 119 |
74 | 75 | 76 | 77 | 81 | 82 |
Instance Methods[hide private]
83 |
87 |   88 | 89 | 90 | 91 | 93 | 97 | 98 |
__init__(self, 92 | *args) 94 | source code 95 | 96 |
99 | 100 |
104 |   105 | 106 | 107 | 108 | 110 | 114 | 115 |
__call__(self, 109 | x) 111 | source code 112 | 113 |
116 | 117 |
120 | 121 | 123 | 124 | 125 | 127 | 128 | 129 | 131 | 132 | 133 | 135 | 136 | 137 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 148 | 152 | 153 |
154 | 155 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /comocma-epydocs/comocma.hv-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.hv 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 44 | 55 | 56 |
39 | 40 | Package comocma :: 41 | Module hv 42 | 43 | 45 | 46 | 47 | 49 | 53 |
[hide private]
[frames] | no frames]
54 |
57 | 58 |

Module hv

source code

59 |
60 |

Author: 61 | Simon Wessing 62 |

63 |
64 | 65 | 67 | 68 | 79 | 80 | 81 | 88 | 89 | 90 | 96 | 97 |
69 | 70 | 71 | 72 | 76 | 77 |
Classes[hide private]
78 |
82 |   83 | 84 | HyperVolume
85 | Hypervolume computation based on variant 3 of the algorithm in the 86 | paper: C. 87 |
91 |   92 | 93 | MultiList
94 | A special data structure needed by FonsecaHyperVolume. 95 |
98 | 99 | 100 | 102 | 103 | 114 | 115 | 116 | 121 | 122 |
104 | 105 | 106 | 107 | 111 | 112 |
Variables[hide private]
113 |
117 |   118 | 119 | __package__ = 'comocma' 120 |
123 | 124 | 126 | 127 | 128 | 130 | 131 | 132 | 134 | 135 | 136 | 138 | 139 | 140 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 151 | 155 | 156 |
157 | 158 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /comocma-epydocs/comocma.hv.MultiList.Node-class.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.hv.MultiList.Node 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 46 | 57 | 58 |
39 | 40 | Package comocma :: 41 | Module hv :: 42 | Class MultiList :: 43 | Class Node 44 | 45 | 47 | 48 | 49 | 51 | 55 |
[hide private]
[frames] | no frames]
56 |
59 | 60 |

Class Node

source code

61 | 62 | 63 | 65 | 66 | 77 | 78 | 79 | 95 | 96 | 97 | 111 | 112 |
67 | 68 | 69 | 70 | 74 | 75 |
Instance Methods[hide private]
76 |
80 |   81 | 82 | 83 | 84 | 87 | 91 | 92 |
__init__(self, 85 | numberLists, 86 | cargo=None) 88 | source code 89 | 90 |
93 | 94 |
98 |   99 | 100 | 101 | 102 | 103 | 107 | 108 |
__str__(self) 104 | source code 105 | 106 |
109 | 110 |
113 | 114 | 116 | 117 | 118 | 120 | 121 | 122 | 124 | 125 | 126 | 128 | 129 | 130 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 141 | 145 | 146 |
147 | 148 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /comocma-epydocs/comocma.nondominatedarchive-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.nondominatedarchive 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 44 | 55 | 56 |
39 | 40 | Package comocma :: 41 | Module nondominatedarchive 42 | 43 | 45 | 46 | 47 | 49 | 53 |
[hide private]
[frames] | no frames]
54 |
57 | 58 |

Module nondominatedarchive

source code

59 | 60 | 61 | 63 | 64 | 75 | 76 | 77 | 84 | 85 |
65 | 66 | 67 | 68 | 72 | 73 |
Classes[hide private]
74 |
78 |   79 | 80 | NonDominatedList
81 | A list of objective values in an empirical Pareto front, meaning 82 | that no point strictly domminates another one in all objectives. 83 |
86 | 87 | 88 | 90 | 91 | 102 | 103 | 104 | 109 | 110 |
92 | 93 | 94 | 95 | 99 | 100 |
Variables[hide private]
101 |
105 |   106 | 107 | __package__ = 'comocma' 108 |
111 | 112 | 114 | 115 | 116 | 118 | 119 | 120 | 122 | 123 | 124 | 126 | 127 | 128 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 139 | 143 | 144 |
145 | 146 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /comocma-epydocs/comocma.sofomore_logger-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma.sofomore_logger 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 44 | 55 | 56 |
39 | 40 | Package comocma :: 41 | Module sofomore_logger 42 | 43 | 45 | 46 | 47 | 49 | 53 |
[hide private]
[frames] | no frames]
54 |
57 | 58 |

Module sofomore_logger

source code

59 | 60 | 61 | 63 | 64 | 75 | 76 | 77 | 83 | 84 |
65 | 66 | 67 | 68 | 72 | 73 |
Classes[hide private]
74 |
78 |   79 | 80 | SofomoreDataLogger
81 | data logger for class `CMAEvolutionStrategy`. 82 |
85 | 86 | 87 | 89 | 90 | 101 | 102 | 103 | 108 | 109 |
91 | 92 | 93 | 94 | 98 | 99 |
Variables[hide private]
100 |
104 |   105 | 106 | __package__ = 'comocma' 107 |
110 | 111 | 113 | 114 | 115 | 117 | 118 | 119 | 121 | 122 | 123 | 125 | 126 | 127 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 138 | 142 | 143 |
144 | 145 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /comocma-epydocs/crarr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CMA-ES/pycomocma/709dc6ff83acfe4f312f04ec2d4bc6daefecff95/comocma-epydocs/crarr.png -------------------------------------------------------------------------------- /comocma-epydocs/epydoc.js: -------------------------------------------------------------------------------- 1 | function toggle_private() { 2 | // Search for any private/public links on this page. Store 3 | // their old text in "cmd," so we will know what action to 4 | // take; and change their text to the opposite action. 5 | var cmd = "?"; 6 | var elts = document.getElementsByTagName("a"); 7 | for(var i=0; i...
"; 127 | elt.innerHTML = s; 128 | } 129 | } 130 | 131 | function toggle(id) { 132 | elt = document.getElementById(id+"-toggle"); 133 | if (elt.innerHTML == "-") 134 | collapse(id); 135 | else 136 | expand(id); 137 | return false; 138 | } 139 | 140 | function highlight(id) { 141 | var elt = document.getElementById(id+"-def"); 142 | if (elt) elt.className = "py-highlight-hdr"; 143 | var elt = document.getElementById(id+"-expanded"); 144 | if (elt) elt.className = "py-highlight"; 145 | var elt = document.getElementById(id+"-collapsed"); 146 | if (elt) elt.className = "py-highlight"; 147 | } 148 | 149 | function num_lines(s) { 150 | var n = 1; 151 | var pos = s.indexOf("\n"); 152 | while ( pos > 0) { 153 | n += 1; 154 | pos = s.indexOf("\n", pos+1); 155 | } 156 | return n; 157 | } 158 | 159 | // Collapse all blocks that mave more than `min_lines` lines. 160 | function collapse_all(min_lines) { 161 | var elts = document.getElementsByTagName("div"); 162 | for (var i=0; i 0) 166 | if (elt.id.substring(split, elt.id.length) == "-expanded") 167 | if (num_lines(elt.innerHTML) > min_lines) 168 | collapse(elt.id.substring(0, split)); 169 | } 170 | } 171 | 172 | function expandto(href) { 173 | var start = href.indexOf("#")+1; 174 | if (start != 0 && start != href.length) { 175 | if (href.substring(start, href.length) != "-") { 176 | collapse_all(4); 177 | pos = href.indexOf(".", start); 178 | while (pos != -1) { 179 | var id = href.substring(start, pos); 180 | expand(id); 181 | pos = href.indexOf(".", pos+1); 182 | } 183 | var id = href.substring(start, href.length); 184 | expand(id); 185 | highlight(id); 186 | } 187 | } 188 | } 189 | 190 | function kill_doclink(id) { 191 | var parent = document.getElementById(id); 192 | parent.removeChild(parent.childNodes.item(0)); 193 | } 194 | function auto_kill_doclink(ev) { 195 | if (!ev) var ev = window.event; 196 | if (!this.contains(ev.toElement)) { 197 | var parent = document.getElementById(this.parentID); 198 | parent.removeChild(parent.childNodes.item(0)); 199 | } 200 | } 201 | 202 | function doclink(id, name, targets_id) { 203 | var elt = document.getElementById(id); 204 | 205 | // If we already opened the box, then destroy it. 206 | // (This case should never occur, but leave it in just in case.) 207 | if (elt.childNodes.length > 1) { 208 | elt.removeChild(elt.childNodes.item(0)); 209 | } 210 | else { 211 | // The outer box: relative + inline positioning. 212 | var box1 = document.createElement("div"); 213 | box1.style.position = "relative"; 214 | box1.style.display = "inline"; 215 | box1.style.top = 0; 216 | box1.style.left = 0; 217 | 218 | // A shadow for fun 219 | var shadow = document.createElement("div"); 220 | shadow.style.position = "absolute"; 221 | shadow.style.left = "-1.3em"; 222 | shadow.style.top = "-1.3em"; 223 | shadow.style.background = "#404040"; 224 | 225 | // The inner box: absolute positioning. 226 | var box2 = document.createElement("div"); 227 | box2.style.position = "relative"; 228 | box2.style.border = "1px solid #a0a0a0"; 229 | box2.style.left = "-.2em"; 230 | box2.style.top = "-.2em"; 231 | box2.style.background = "white"; 232 | box2.style.padding = ".3em .4em .3em .4em"; 233 | box2.style.fontStyle = "normal"; 234 | box2.onmouseout=auto_kill_doclink; 235 | box2.parentID = id; 236 | 237 | // Get the targets 238 | var targets_elt = document.getElementById(targets_id); 239 | var targets = targets_elt.getAttribute("targets"); 240 | var links = ""; 241 | target_list = targets.split(","); 242 | for (var i=0; i" + 246 | target[0] + ""; 247 | } 248 | 249 | // Put it all together. 250 | elt.insertBefore(box1, elt.childNodes.item(0)); 251 | //box1.appendChild(box2); 252 | box1.appendChild(shadow); 253 | shadow.appendChild(box2); 254 | box2.innerHTML = 255 | "Which "+name+" do you want to see documentation for?" + 256 | ""; 261 | } 262 | return false; 263 | } 264 | 265 | function get_anchor() { 266 | var href = location.href; 267 | var start = href.indexOf("#")+1; 268 | if ((start != 0) && (start != href.length)) 269 | return href.substring(start, href.length); 270 | } 271 | function redirect_url(dottedName) { 272 | // Scan through each element of the "pages" list, and check 273 | // if "name" matches with any of them. 274 | for (var i=0; i-m" or "-c"; 277 | // extract the portion & compare it to dottedName. 278 | var pagename = pages[i].substring(0, pages[i].length-2); 279 | if (pagename == dottedName.substring(0,pagename.length)) { 280 | 281 | // We've found a page that matches `dottedName`; 282 | // construct its URL, using leftover `dottedName` 283 | // content to form an anchor. 284 | var pagetype = pages[i].charAt(pages[i].length-1); 285 | var url = pagename + ((pagetype=="m")?"-module.html": 286 | "-class.html"); 287 | if (dottedName.length > pagename.length) 288 | url += "#" + dottedName.substring(pagename.length+1, 289 | dottedName.length); 290 | return url; 291 | } 292 | } 293 | } 294 | -------------------------------------------------------------------------------- /comocma-epydocs/frames.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /comocma-epydocs/help.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Help 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 50 | 51 |
  40 | 41 | 42 | 44 | 48 |
[hide private]
[frames] | no frames]
49 |
52 | 53 |

API Documentation

54 | 55 |

This document contains the API (Application Programming Interface) 56 | documentation for this project. Documentation for the Python 57 | objects defined by the project is divided into separate pages for each 58 | package, module, and class. The API documentation also includes two 59 | pages containing information about the project as a whole: a trees 60 | page, and an index page.

61 | 62 |

Object Documentation

63 | 64 |

Each Package Documentation page contains:

65 |
    66 |
  • A description of the package.
  • 67 |
  • A list of the modules and sub-packages contained by the 68 | package.
  • 69 |
  • A summary of the classes defined by the package.
  • 70 |
  • A summary of the functions defined by the package.
  • 71 |
  • A summary of the variables defined by the package.
  • 72 |
  • A detailed description of each function defined by the 73 | package.
  • 74 |
  • A detailed description of each variable defined by the 75 | package.
  • 76 |
77 | 78 |

Each Module Documentation page contains:

79 |
    80 |
  • A description of the module.
  • 81 |
  • A summary of the classes defined by the module.
  • 82 |
  • A summary of the functions defined by the module.
  • 83 |
  • A summary of the variables defined by the module.
  • 84 |
  • A detailed description of each function defined by the 85 | module.
  • 86 |
  • A detailed description of each variable defined by the 87 | module.
  • 88 |
89 | 90 |

Each Class Documentation page contains:

91 |
    92 |
  • A class inheritance diagram.
  • 93 |
  • A list of known subclasses.
  • 94 |
  • A description of the class.
  • 95 |
  • A summary of the methods defined by the class.
  • 96 |
  • A summary of the instance variables defined by the class.
  • 97 |
  • A summary of the class (static) variables defined by the 98 | class.
  • 99 |
  • A detailed description of each method defined by the 100 | class.
  • 101 |
  • A detailed description of each instance variable defined by the 102 | class.
  • 103 |
  • A detailed description of each class (static) variable defined 104 | by the class.
  • 105 |
106 | 107 |

Project Documentation

108 | 109 |

The Trees page contains the module and class hierarchies:

110 |
    111 |
  • The module hierarchy lists every package and module, with 112 | modules grouped into packages. At the top level, and within each 113 | package, modules and sub-packages are listed alphabetically.
  • 114 |
  • The class hierarchy lists every class, grouped by base 115 | class. If a class has more than one base class, then it will be 116 | listed under each base class. At the top level, and under each base 117 | class, classes are listed alphabetically.
  • 118 |
119 | 120 |

The Index page contains indices of terms and 121 | identifiers:

122 |
    123 |
  • The term index lists every term indexed by any object's 124 | documentation. For each term, the index provides links to each 125 | place where the term is indexed.
  • 126 |
  • The identifier index lists the (short) name of every package, 127 | module, class, method, function, variable, and parameter. For each 128 | identifier, the index provides a short description, and a link to 129 | its documentation.
  • 130 |
131 | 132 |

The Table of Contents

133 | 134 |

The table of contents occupies the two frames on the left side of 135 | the window. The upper-left frame displays the project 136 | contents, and the lower-left frame displays the module 137 | contents:

138 | 139 | 140 | 141 | 143 | 146 | 147 | 148 | 151 | 152 |
142 | Project
Contents
...
144 | API
Documentation
Frame


145 |
149 | Module
Contents
 
...
  150 |

153 | 154 |

The project contents frame contains a list of all packages 155 | and modules that are defined by the project. Clicking on an entry 156 | will display its contents in the module contents frame. Clicking on a 157 | special entry, labeled "Everything," will display the contents of 158 | the entire project.

159 | 160 |

The module contents frame contains a list of every 161 | submodule, class, type, exception, function, and variable defined by a 162 | module or package. Clicking on an entry will display its 163 | documentation in the API documentation frame. Clicking on the name of 164 | the module, at the top of the frame, will display the documentation 165 | for the module itself.

166 | 167 |

The "frames" and "no frames" buttons below the top 168 | navigation bar can be used to control whether the table of contents is 169 | displayed or not.

170 | 171 |

The Navigation Bar

172 | 173 |

A navigation bar is located at the top and bottom of every page. 174 | It indicates what type of page you are currently viewing, and allows 175 | you to go to related pages. The following table describes the labels 176 | on the navigation bar. Note that not some labels (such as 177 | [Parent]) are not displayed on all pages.

178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 192 | 193 | 194 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 |
LabelHighlighted when...Links to...
[Parent](never highlighted) the parent of the current package
[Package]viewing a packagethe package containing the current object 191 |
[Module]viewing a modulethe module containing the current object 195 |
[Class]viewing a class the class containing the current object
[Trees]viewing the trees page the trees page
[Index]viewing the index page the index page
[Help]viewing the help page the help page
209 | 210 |

The "show private" and "hide private" buttons below 211 | the top navigation bar can be used to control whether documentation 212 | for private objects is displayed. Private objects are usually defined 213 | as objects whose (short) names begin with a single underscore, but do 214 | not end with an underscore. For example, "_x", 215 | "__pprint", and "epydoc.epytext._tokenize" 216 | are private objects; but "re.sub", 217 | "__init__", and "type_" are not. However, 218 | if a module defines the "__all__" variable, then its 219 | contents are used to decide which objects are private.

220 | 221 |

A timestamp below the bottom navigation bar indicates when each 222 | page was last updated.

223 | 224 | 226 | 227 | 228 | 230 | 231 | 232 | 234 | 235 | 236 | 238 | 239 | 240 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 251 | 255 | 256 |
257 | 258 | 267 | 268 | 269 | -------------------------------------------------------------------------------- /comocma-epydocs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | API Documentation 7 | 8 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /comocma-epydocs/module-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Module Hierarchy 7 | 8 | 9 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 50 | 51 |
  40 | 41 | 42 | 44 | 48 |
[hide private]
[frames] | no frames]
49 |
52 |
53 | [ Module Hierarchy 54 | | Class Hierarchy ] 55 |

56 |

Module Hierarchy

57 |
    58 |
  • comocma: This module contains the implementation of the Multiobjective framework called 59 | Sofomore, and its instantiation with cma-es to obtain COMO-CMA-ES, defined in 60 | the paper [Toure, Cheikh, et al. 61 | 70 |
  • 71 |
72 | 73 | 75 | 76 | 77 | 79 | 80 | 81 | 83 | 84 | 85 | 87 | 88 | 89 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 100 | 104 | 105 |
106 | 107 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /comocma-epydocs/redirect.html: -------------------------------------------------------------------------------- 1 | Epydoc Redirect Page 2 | 3 | 4 | 5 | 6 | 7 | 8 | 18 | 19 |

Epydoc Auto-redirect page

20 | 21 |

When javascript is enabled, this page will redirect URLs of 22 | the form redirect.html#dotted.name to the 23 | documentation for the object with the given fully-qualified 24 | dotted name.

25 |

 

26 | 27 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /comocma-epydocs/toc-comocma-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | comocma 7 | 8 | 9 | 10 | 11 | 13 |

Module comocma

14 |
15 |

Variables

16 | __package__

18 | [hide private] 20 | 21 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /comocma-epydocs/toc-comocma.__main__-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | __main__ 7 | 8 | 9 | 10 | 11 | 13 |

Module __main__

14 |
15 |

Variables

16 | 19 |
20 | [hide private] 22 | 23 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /comocma-epydocs/toc-comocma.como-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | como 7 | 8 | 9 | 10 | 11 | 13 |

Module como

14 |
15 |

Classes

16 | CmaKernel
FitFun
IndicatorFront
Sofomore

Functions

21 | get_cmas
sort_decreasing
sort_even_odds
sort_increasing
sort_odds_even
sort_random

Variables

28 | __package__
cma_kernel_default_options_replacements

31 | [hide private] 33 | 34 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /comocma-epydocs/toc-comocma.hv-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | hv 7 | 8 | 9 | 10 | 11 | 13 |

Module hv

14 |
15 |

Classes

16 | HyperVolume
MultiList

Variables

19 | __package__

21 | [hide private] 23 | 24 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /comocma-epydocs/toc-comocma.nondominatedarchive-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | nondominatedarchive 7 | 8 | 9 | 10 | 11 | 13 |

Module nondominatedarchive

14 |
15 |

Classes

16 | NonDominatedList

Variables

18 | __package__

20 | [hide private] 22 | 23 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /comocma-epydocs/toc-comocma.sofomore_logger-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | sofomore_logger 7 | 8 | 9 | 10 | 11 | 13 |

Module sofomore_logger

14 |
15 |

Classes

16 | SofomoreDataLogger

Variables

18 | __package__

20 | [hide private] 22 | 23 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /comocma-epydocs/toc-everything.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Everything 7 | 8 | 9 | 10 | 11 | 13 |

Everything

14 |
15 |

All Classes

16 | comocma.como.CmaKernel
comocma.como.FitFun
comocma.como.IndicatorFront
comocma.como.Sofomore
comocma.hv.HyperVolume
comocma.hv.MultiList
comocma.hv.MultiList.Node
comocma.nondominatedarchive.NonDominatedList
comocma.sofomore_logger.SofomoreDataLogger

All Functions

26 | comocma.como.get_cmas
comocma.como.sort_decreasing
comocma.como.sort_even_odds
comocma.como.sort_increasing
comocma.como.sort_odds_even
comocma.como.sort_random

All Variables

33 | 36 | comocma.__package__
comocma.como.__package__
comocma.como.cma_kernel_default_options_replacements
comocma.hv.__package__
comocma.nondominatedarchive.__package__
comocma.sofomore_logger.__package__

43 | [hide private] 45 | 46 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /comocma-epydocs/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Table of Contents 7 | 8 | 9 | 10 | 11 | 13 |

Table of Contents

14 |
15 | Everything 16 |
17 |

Modules

18 | comocma
22 | comocma.como
comocma.hv
comocma.nondominatedarchive
comocma.sofomore_logger

27 | [hide private] 29 | 30 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /comocma/LICENSE: -------------------------------------------------------------------------------- 1 | The BSD 3-Clause License 2 | Copyright (c) 2019 Inria 3 | Authors: Cheikh Toure and Nikolaus Hansen, 2019 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright and 10 | authors notice, this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | and authors notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided with 15 | the distribution. 16 | 17 | 3. Neither the name of the copyright holder nor the names of its 18 | contributors nor the authors names may be used to endorse or promote 19 | products derived from this software without specific prior written 20 | permission. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES 26 | OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 27 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 28 | DEALINGS IN THE SOFTWARE. 29 | -------------------------------------------------------------------------------- /comocma/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | This module contains the implementation of the Multiobjective framework called 4 | Sofomore, and its instantiation with cma-es to obtain COMO-CMA-ES, defined in 5 | the paper [Toure, Cheikh, et al. "Uncrowded Hypervolume Improvement: 6 | COMO-CMA-ES and the Sofomore framework." 7 | GECCO'19-Genetic and Evolutionary Computation Conference. 2019.]. 8 | 9 | Only the bi-objective framework is functional and has been thoroughly tested. 10 | 11 | 12 | :Author: Cheikh Toure and Nikolaus Hansen, 2019 13 | 14 | :License: BSD 3-Clause, see LICENSE file. 15 | 16 | """ 17 | 18 | from . import como, sofomore_logger, hv, nondominatedarchive 19 | 20 | from .como import (Sofomore, IndicatorFront, get_cmas, CmaKernel, FitFun, 21 | sort_random, sort_decreasing, sort_even_odds, sort_increasing, 22 | sort_odds_even) 23 | 24 | from .como import __author__, __license__, __version__ 25 | 26 | from .sofomore_logger import SofomoreDataLogger 27 | 28 | from .nondominatedarchive import NonDominatedList 29 | 30 | -------------------------------------------------------------------------------- /comocma/__main__.py: -------------------------------------------------------------------------------- 1 | import doctest 2 | import comocma 3 | 4 | doctest.ELLIPSIS_MARKER = '***' # to be able to ignore an entire output, 5 | # putting the default '...' doesn't work for that. 6 | print('doctesting `comocma`') 7 | print(doctest.testmod(comocma.como)) 8 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | ``pycomocma`` is a Python implementation of [COMO-CMA-ES](https://hal.inria.fr/hal-02103694/document) which is a Multiobjective Evolution Strategy, based upon the [Covariance Matrix Adaptation Evolution Strategy](https://en.wikipedia.org/wiki/CMA-ES) 4 | ([CMA-ES](http://cma.gforge.inria.fr/)) single optimizer. 5 | 6 | For the time being, only the bi-objective case is tested and functional. 7 | 8 | ## Installation 9 | 10 | From [PyPI](https://pypi.org/project/comocma/) via 11 | 12 | ```sh 13 | python -m pip install comocma 14 | ``` 15 | 16 | or from [GitHub](https://github.com/CMA-ES/pycomocma), for example, via 17 | 18 | ```sh 19 | python -m pip install git+https://github.com/CMA-ES/pycomocma.git@master 20 | ``` 21 | 22 | ## Links 23 | 24 | - [Code on Github](https://github.com/CMA-ES/pycomocma) 25 | - Documentation in 26 | - [apidocs format](https://cma-es.github.io/pycomocma/comocma-apidocs/index.html) 27 | - [epydocs format](https://cma-es.github.io/pycomocma/comocma-epydocs/index.html) 28 | 29 | ## Testing of the `comocma` module 30 | 31 | The script 32 | 33 | ```sh 34 | python -m comocma 35 | ``` 36 | 37 | runs the test written in the `__main__` file. 38 | 39 | # Example code 40 | 41 | 42 | ```python 43 | import cma, comocma 44 | 45 | ### Settings 46 | dimension = 10 # dimension of the search space 47 | num_kernels = 5 # number of single-objective solvers 48 | sigma0 = 0.2 # initial step-sizes 49 | 50 | ### Initialize 51 | list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], sigma0) # return num_kernels cma instances 52 | moes = comocma.Sofomore(list_of_solvers, [11,11]) # create a como-cma-es instance 53 | 54 | fitness = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)) # a callable bi-objective function 55 | 56 | ### Do the job 57 | moes.optimize(fitness) 58 | ``` 59 | 60 | ### Output: 61 | 62 | ``` 63 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 64 | (median) (median) (median) 65 | 1 10 1.210000000000000e+00 1.0e+00 2.00e-01 2e-01 2e-01 66 | 2 20 1.210000000000000e+00 1.0e+00 2.00e-01 2e-01 2e-01 67 | 3 30 1.210000000000000e+00 1.0e+00 1.85e-01 2e-01 2e-01 68 | 100 1000 1.207601015381810e+00 1.6e+00 3.40e-02 3e-02 3e-02 69 | 200 2000 1.209903687756354e+00 1.7e+00 7.74e-03 5e-03 6e-03 70 | 300 3000 1.209997694077156e+00 1.8e+00 2.03e-03 1e-03 1e-03 71 | 400 4000 1.209999800600613e+00 1.8e+00 4.90e-04 2e-04 3e-04 72 | 480 4800 1.209999979594839e+00 1.9e+00 2.02e-04 7e-05 9e-05 73 | ``` 74 | Now, 75 | 76 | ```python 77 | moes.kernels[0].result 78 | ``` 79 | 80 | contains the [result](https://cma-es.github.io/apidocs-pycma/cma.evolution_strategy.CMAEvolutionStrategy.html#result) of the first kernel. 81 | 82 | ## Explanations step-by-step 83 | 84 | ### Importing necessary packages: 85 | ```python 86 | import cma, comocma 87 | ``` 88 | 89 | ### Setting parameters: 90 | ```python 91 | dimension = 10 # dimension of the search space 92 | num_kernels = 5 # number of single-objective solvers (number of points on the front) 93 | sigma0 = 0.2 # initial step-sizes 94 | ``` 95 | 96 | ### Instantiate a multiobjective solver 97 | ```python 98 | list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], sigma0) # produce `num_kernels cma instances` 99 | moes = comocma.Sofomore(list_of_solvers, reference_point=[11, 11]) # create a bi-objective como-cma-es instance 100 | moes3 = comocma.Sofomore(list_of_solvers, reference_point=[11, 11, 11]) # create a multiobjective como-cma-es instance 101 | ``` 102 | 103 | ### Setting a callable multiobjective function 104 | ```python 105 | fitness = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)) # a callable bi-objective function 106 | fitness3 = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1), lambda x: cma.ff.sphere(x+1)) # a callable multiobjective function 107 | ``` 108 | 109 | # More specific use cases 110 | 111 | ## Example of single-objective options for CMA-ES 112 | ```python 113 | list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], 0.2, inopts={'bounds': [0.2, 0.9], 'tolx': 10**-7,'popsize': 32}) 114 | # produce `num_kernels cma instances` 115 | moes = comocma.Sofomore(list_of_solvers, [1.1, 1.1]) # create a como-cma-es instance 116 | ``` 117 | 118 | ## Example of Multiobjective options 119 | ```python 120 | list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], 0.2) 121 | moes = comocma.Sofomore(list_of_solvers, [1.1, 1.1], opts={'archive': True, 'restart': None, 'update_order': None}) # create a como-cma-es instance 122 | ``` 123 | 124 | ## The `Optimize` interface 125 | 126 | ### Initialization 127 | ```python 128 | import cma, comocma 129 | 130 | dimension = 10 # dimension of the search space 131 | num_kernels = 5 # number of single-objective solvers (number of points on the front) 132 | sigma0 = 0.2 # initial step-sizes 133 | 134 | list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], sigma0) # produce `num_kernels cma instances` 135 | moes = comocma.Sofomore(list_of_solvers, [11,11]) # create a como-cma-es instance 136 | 137 | fitness = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)) # a callable bi-objective function 138 | ``` 139 | 140 | ### Optimizing `fitness` with a limited number of iterations 141 | 142 | ```python 143 | moes.optimize(fitness, iterations=300) 144 | ``` 145 | ``` 146 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 147 | (median) (median) (median) 148 | 1 10 1.100000000000000e+01 1.0e+00 2.00e-01 2e-01 2e-01 149 | 2 20 2.158412269365152e+01 1.0e+00 2.00e-01 2e-01 2e-01 150 | 3 30 2.896035267829712e+01 1.0e+00 1.98e-01 2e-01 2e-01 151 | 100 1000 9.512982413314423e+01 1.7e+00 1.01e-01 8e-02 9e-02 152 | 200 2000 9.703624875547615e+01 1.9e+00 4.27e-02 3e-02 4e-02 153 | 300 3000 9.722958234416403e+01 1.9e+00 1.63e-02 9e-03 1e-02 154 | ``` 155 | 156 | 157 | ### Optimizing `fitness` with a maximum number of evaluations 158 | 159 | ```python 160 | moes.optimize(fitness, maxfun=3000) 161 | ``` 162 | ``` 163 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 164 | (median) (median) (median) 165 | 1 10 1.100000000000000e+01 1.0e+00 2.00e-01 2e-01 2e-01 166 | 2 20 2.158412269365152e+01 1.0e+00 2.00e-01 2e-01 2e-01 167 | 3 30 2.896035267829712e+01 1.0e+00 1.98e-01 2e-01 2e-01 168 | 100 1000 9.512982413314423e+01 1.7e+00 1.01e-01 8e-02 9e-02 169 | 200 2000 9.703624875547615e+01 1.9e+00 4.27e-02 3e-02 4e-02 170 | 300 3000 9.722958234416403e+01 1.9e+00 1.63e-02 9e-03 1e-02 171 | ``` 172 | 173 | 174 | ## The `ask-and-tell` interface 175 | 176 | ```python 177 | while not moes.stop(): 178 | solutions = moes.ask("all") 179 | objective_values = [fitness(x) for x in solutions] 180 | moes.tell(solutions, objective_values) 181 | moes.disp() # display datas during the optimization 182 | moes.logger.add() # logging data after each `ask` and `tell` call 183 | ``` 184 | 185 | ``` 186 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 187 | (median) (median) (median) 188 | 1 180 1.990425600000000e-01 1.0e+00 1.88e-01 2e-01 2e-01 189 | 2 360 2.279075246432772e-01 1.1e+00 1.87e-01 2e-01 2e-01 190 | 3 540 2.436105134581627e-01 1.2e+00 1.90e-01 2e-01 2e-01 191 | 100 18000 3.607157703968831e-01 2.1e+00 1.80e-02 1e-02 2e-02 192 | 200 35172 3.635275131024869e-01 2.1e+00 5.95e-03 4e-03 5e-03 193 | 300 49788 3.637412031970786e-01 2.2e+00 1.29e-03 8e-04 1e-03 194 | 320 50784 3.637421277015990e-01 2.2e+00 1.26e-03 7e-04 9e-04 195 | ``` 196 | 197 | ### Argument of `moes.ask` 198 | 199 | ```python 200 | solutions = moes.ask() # we generate offspring for only one kernel (sequential) 201 | solutions = moes.ask("all") # we generate offspring simultaneously for all kernels (parallel) 202 | solutions = moes.ask(number_asks) # we generate offspring for `number_asks` kernels 203 | ``` 204 | 205 | ## Picklable object: saving and resuming a MO optimization with the `ask-and-tell` interface 206 | 207 | ### Initialization 208 | 209 | ```python 210 | import cma, como, pickle 211 | 212 | dimension = 10 # dimension of the search space 213 | num_kernels = 5 # number of single-objective solvers (number of points on the front) 214 | sigma0 = 0.2 # initial step-sizes 215 | 216 | list_of_solvers = como.get_cmas(num_kernels * [dimension * [0]], sigma0) # produce `num_kernels cma instances` 217 | moes = como.Sofomore(list_of_solvers, reference_point = [11,11]) # create a como-cma-es instance 218 | 219 | fitness = como.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)) # a callable bi-objective function 220 | ``` 221 | 222 | ### Saving an optimization 223 | 224 | ```python 225 | for i in range(100): 226 | solutions = moes.ask() 227 | objective_values = [fitness(x) for x in solutions] 228 | moes.tell(solutions, objective_values) 229 | moes.disp() 230 | 231 | pickle.dump(moes, open('saved-mocma-object.pkl', 'wb')) # we save the instance 232 | print('saved') 233 | del moes # deleting completely the Sofomore instance 234 | ``` 235 | 236 | ### Output 237 | 238 | ``` 239 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 240 | (median) (median) (median) 241 | 1 10 1.100000000000000e+01 1.0e+00 2.00e-01 2e-01 2e-01 242 | 2 20 2.845200549045931e+01 1.0e+00 2.00e-01 2e-01 2e-01 243 | 3 30 3.440089785096067e+01 1.0e+00 2.00e-01 2e-01 2e-01 244 | 100 1000 9.562953505152342e+01 1.9e+00 1.13e-01 9e-02 1e-01 245 | saved 246 | ``` 247 | 248 | ### Resuming an optimization 249 | 250 | ```python 251 | moes = pickle.load(open('saved-mocma-object.pkl', 'rb')) # we load the saved file here 252 | 253 | moes.optimize(fitness, iterations=400) 254 | ``` 255 | 256 | ### Output 257 | 258 | ``` 259 | 200 2000 9.716644477685412e+01 1.9e+00 3.33e-02 2e-02 3e-02 260 | 300 3000 9.723550009906029e+01 2.0e+00 1.13e-02 6e-03 8e-03 261 | 400 4000 9.724067117112808e+01 1.9e+00 2.95e-03 1e-03 2e-03 262 | 500 5000 9.724107479961819e+01 2.0e+00 9.38e-04 4e-04 5e-04 263 | ``` 264 | 265 | ## Example of plots 266 | 267 | ### COMO-CMA-ES data plottings 268 | 269 | ```python 270 | moes.logger.plot_front() 271 | ``` 272 | ![image info](./readme_images/front.png ) 273 | 274 | ```python 275 | moes.logger.plot_divers() 276 | ``` 277 | ![image info](./readme_images/divers.png ) 278 | 279 | ### CMA-ES plots of written data 280 | 281 | ```python 282 | cma.plot("cma_kernels/0") 283 | ``` 284 | ![image info](./readme_images/cma-example.png ) 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | ``pycomocma`` is a Python implementation of [COMO-CMA-ES](https://hal.inria.fr/hal-02103694/document) which is a Multiobjective Evolution Strategy, based upon the [Covariance Matrix Adaptation Evolution Strategy](https://en.wikipedia.org/wiki/CMA-ES) 4 | ([CMA-ES](http://cma.gforge.inria.fr/)) single optimizer. 5 | 6 | For the time being, only the bi-objective case is tested and functional. 7 | 8 | ## Installation 9 | 10 | Either via 11 | ``` 12 | pip install git+https://github.com/CMA-ES/pycomocma.git@master 13 | ``` 14 | 15 | or simply via 16 | 17 | ``` 18 | pip install comocma 19 | ``` 20 | 21 | 22 | ## Links 23 | 24 | - [Code on Github](https://github.com/CMA-ES/pycomocma) 25 | - Documentation in 26 | - [apidocs format](https://cma-es.github.io/pycomocma/comocma-apidocs/index.html) 27 | - [epydocs format](https://cma-es.github.io/pycomocma/comocma-epydocs/index.html) 28 | 29 | ## Testing of the `comocma` module 30 | 31 | The script 32 | ``` 33 | python -m comocma 34 | ``` 35 | runs the test written in the `__main__` file. 36 | 37 | 38 | # Use cases 39 | 40 | ## Instantiating a multiobjective solver 41 | 42 | ### Importing necessary packages: 43 | ```python 44 | import cma, comocma 45 | ``` 46 | 47 | ### Setting parameters: 48 | ```python 49 | dimension = 10 # dimension of the search space 50 | num_kernels = 5 # number of single-objective solvers (number of points on the front) 51 | sigma0 = 0.2 # initial step-sizes 52 | ``` 53 | 54 | ### Instantiate a multiobjective solver 55 | ```python 56 | list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], sigma0) # produce `num_kernels cma instances` 57 | moes = comocma.Sofomore(list_of_solvers, reference_point=[11, 11]) # create a bi-objective como-cma-es instance 58 | moes3 = comocma.Sofomore(list_of_solvers, reference_point=[11, 11, 11]) # create a multiobjective como-cma-es instance 59 | ``` 60 | 61 | ### Setting a callable multiobjective function 62 | ```python 63 | fitness = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)) # a callable bi-objective function 64 | fitness3 = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1), lambda x: cma.ff.sphere(x+1)) # a callable multiobjective function 65 | ``` 66 | 67 | ### Single-objective options: a use case with few cma-es' options 68 | ```python 69 | list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], 0.2, inopts={'bounds': [0.2, 0.9], 'tolx': 10**-7,'popsize': 32}) 70 | # produce `num_kernels cma instances` 71 | moes = comocma.Sofomore(list_of_solvers, [1.1, 1.1]) # create a como-cma-es instance 72 | ``` 73 | 74 | ### Use case with some Multiobjective options 75 | ```python 76 | list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], 0.2) 77 | moes = comocma.Sofomore(list_of_solvers, [1.1, 1.1], opts={'archive': True, 'restart': None, 'update_order': None}) # create a como-cma-es instance 78 | ``` 79 | 80 | 81 | ## The `Optimize` interface 82 | 83 | ### Initialization 84 | ```python 85 | import cma, comocma 86 | 87 | dimension = 10 # dimension of the search space 88 | num_kernels = 5 # number of single-objective solvers (number of points on the front) 89 | sigma0 = 0.2 # initial step-sizes 90 | 91 | list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], sigma0) # produce `num_kernels cma instances` 92 | moes = comocma.Sofomore(list_of_solvers, [11,11]) # create a como-cma-es instance 93 | 94 | fitness = comocma.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)) # a callable bi-objective function 95 | ``` 96 | ### Optimizing `fitness` until default stopping criteria 97 | 98 | ```python 99 | moes.optimize(fitness) 100 | ``` 101 | 102 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 103 | (median) (median) (median) 104 | 1 10 1.210000000000000e+00 1.0e+00 2.00e-01 2e-01 2e-01 105 | 2 20 1.210000000000000e+00 1.0e+00 2.00e-01 2e-01 2e-01 106 | 3 30 1.210000000000000e+00 1.0e+00 1.85e-01 2e-01 2e-01 107 | 100 1000 1.207601015381810e+00 1.6e+00 3.40e-02 3e-02 3e-02 108 | 200 2000 1.209903687756354e+00 1.7e+00 7.74e-03 5e-03 6e-03 109 | 300 3000 1.209997694077156e+00 1.8e+00 2.03e-03 1e-03 1e-03 110 | 400 4000 1.209999800600613e+00 1.8e+00 4.90e-04 2e-04 3e-04 111 | 480 4800 1.209999979594839e+00 1.9e+00 2.02e-04 7e-05 9e-05 112 | 113 | 114 | ### Optimizing `fitness` with a limited number of iterations 115 | 116 | ```python 117 | moes.optimize(fitness, iterations=300) 118 | ``` 119 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 120 | (median) (median) (median) 121 | 1 10 1.100000000000000e+01 1.0e+00 2.00e-01 2e-01 2e-01 122 | 2 20 2.158412269365152e+01 1.0e+00 2.00e-01 2e-01 2e-01 123 | 3 30 2.896035267829712e+01 1.0e+00 1.98e-01 2e-01 2e-01 124 | 100 1000 9.512982413314423e+01 1.7e+00 1.01e-01 8e-02 9e-02 125 | 200 2000 9.703624875547615e+01 1.9e+00 4.27e-02 3e-02 4e-02 126 | 300 3000 9.722958234416403e+01 1.9e+00 1.63e-02 9e-03 1e-02 127 | 128 | 129 | ### Optimizing `fitness` with a maximum number of evaluations 130 | 131 | ```python 132 | moes.optimize(fitness, maxfun=3000) 133 | ``` 134 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 135 | (median) (median) (median) 136 | 1 10 1.100000000000000e+01 1.0e+00 2.00e-01 2e-01 2e-01 137 | 2 20 2.158412269365152e+01 1.0e+00 2.00e-01 2e-01 2e-01 138 | 3 30 2.896035267829712e+01 1.0e+00 1.98e-01 2e-01 2e-01 139 | 100 1000 9.512982413314423e+01 1.7e+00 1.01e-01 8e-02 9e-02 140 | 200 2000 9.703624875547615e+01 1.9e+00 4.27e-02 3e-02 4e-02 141 | 300 3000 9.722958234416403e+01 1.9e+00 1.63e-02 9e-03 1e-02 142 | 143 | 144 | ## The `ask-and-tell` interface 145 | 146 | ```python 147 | while not moes.stop(): 148 | solutions = moes.ask("all") 149 | objective_values = [fitness(x) for x in solutions] 150 | moes.tell(solutions, objective_values) 151 | moes.disp() # display datas during the optimization 152 | moes.logger.add() # logging data after each `ask` and `tell` call 153 | ``` 154 | 155 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 156 | (median) (median) (median) 157 | 1 180 1.990425600000000e-01 1.0e+00 1.88e-01 2e-01 2e-01 158 | 2 360 2.279075246432772e-01 1.1e+00 1.87e-01 2e-01 2e-01 159 | 3 540 2.436105134581627e-01 1.2e+00 1.90e-01 2e-01 2e-01 160 | 100 18000 3.607157703968831e-01 2.1e+00 1.80e-02 1e-02 2e-02 161 | 200 35172 3.635275131024869e-01 2.1e+00 5.95e-03 4e-03 5e-03 162 | 300 49788 3.637412031970786e-01 2.2e+00 1.29e-03 8e-04 1e-03 163 | 320 50784 3.637421277015990e-01 2.2e+00 1.26e-03 7e-04 9e-04 164 | 165 | ### Argument of `moes.ask` 166 | 167 | ```python 168 | solutions = moes.ask() # we generate offspring for only one kernel (sequential) 169 | solutions = moes.ask("all") # we generate offspring simultaneously for all kernels (parallel) 170 | solutions = moes.ask(number_asks) # we generate offspring for `number_asks` kernels 171 | ``` 172 | 173 | ## Picklable object: saving and resuming a MO optimization with the `ask-and-tell` interface 174 | 175 | ### Initialization 176 | 177 | ```python 178 | import cma, como, pickle 179 | 180 | dimension = 10 # dimension of the search space 181 | num_kernels = 5 # number of single-objective solvers (number of points on the front) 182 | sigma0 = 0.2 # initial step-sizes 183 | 184 | list_of_solvers = como.get_cmas(num_kernels * [dimension * [0]], sigma0) # produce `num_kernels cma instances` 185 | moes = como.Sofomore(list_of_solvers, reference_point = [11,11]) # create a como-cma-es instance 186 | 187 | fitness = como.FitFun(cma.ff.sphere, lambda x: cma.ff.sphere(x-1)) # a callable bi-objective function 188 | ``` 189 | 190 | ### Saving an optimization 191 | 192 | ```python 193 | for i in range(100): 194 | solutions = moes.ask() 195 | objective_values = [fitness(x) for x in solutions] 196 | moes.tell(solutions, objective_values) 197 | moes.disp() 198 | 199 | pickle.dump(moes, open('saved-mocma-object.pkl', 'wb')) # we save the instance 200 | print('saved') 201 | del moes # deleting completely the Sofomore instance 202 | ``` 203 | 204 | ### Output 205 | 206 | Iterat #Fevals Hypervolume axis ratios sigmas min&max stds 207 | (median) (median) (median) 208 | 1 10 1.100000000000000e+01 1.0e+00 2.00e-01 2e-01 2e-01 209 | 2 20 2.845200549045931e+01 1.0e+00 2.00e-01 2e-01 2e-01 210 | 3 30 3.440089785096067e+01 1.0e+00 2.00e-01 2e-01 2e-01 211 | 100 1000 9.562953505152342e+01 1.9e+00 1.13e-01 9e-02 1e-01 212 | saved 213 | 214 | ### Resuming an optimization 215 | 216 | ```python 217 | moes = pickle.load(open('saved-mocma-object.pkl', 'rb')) # we load the saved file here 218 | 219 | moes.optimize(fitness, iterations=400) 220 | ``` 221 | 222 | ### Output 223 | 224 | 200 2000 9.716644477685412e+01 1.9e+00 3.33e-02 2e-02 3e-02 225 | 300 3000 9.723550009906029e+01 2.0e+00 1.13e-02 6e-03 8e-03 226 | 400 4000 9.724067117112808e+01 1.9e+00 2.95e-03 1e-03 2e-03 227 | 500 5000 9.724107479961819e+01 2.0e+00 9.38e-04 4e-04 5e-04 228 | 229 | ## Example of plots 230 | 231 | ### COMO-CMA-ES data plottings 232 | 233 | ```python 234 | moes.logger.plot_front() 235 | ``` 236 | ![image info](./readme_images/front.png ) 237 | 238 | ```python 239 | moes.logger.plot_divers() 240 | ``` 241 | ![image info](./readme_images/divers.png ) 242 | 243 | ### CMA-ES plots of written data 244 | 245 | ```python 246 | cma.plot("cma_kernels/0") 247 | ``` 248 | ![image info](./readme_images/cma-example.png ) 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | -------------------------------------------------------------------------------- /readme_images/cma-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CMA-ES/pycomocma/709dc6ff83acfe4f312f04ec2d4bc6daefecff95/readme_images/cma-example.png -------------------------------------------------------------------------------- /readme_images/divers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CMA-ES/pycomocma/709dc6ff83acfe4f312f04ec2d4bc6daefecff95/readme_images/divers.png -------------------------------------------------------------------------------- /readme_images/front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CMA-ES/pycomocma/709dc6ff83acfe4f312f04ec2d4bc6daefecff95/readme_images/front.png -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # from distutils.core import setup 5 | 6 | from setuptools import setup 7 | import warnings 8 | from comocma import __version__ # assumes that the right module is visible first in path, i.e., cma folder is in current folder 9 | from comocma import __doc__ as long_description 10 | 11 | # prevent the error when building Windows .exe 12 | import codecs 13 | try: 14 | codecs.lookup('mbcs') 15 | except LookupError: 16 | ascii = codecs.lookup('ascii') 17 | func = lambda name, enc=ascii: {True: enc}.get(name=='mbcs') 18 | codecs.register(func) 19 | 20 | 21 | try: 22 | with open('readme.md') as file_: 23 | long_description = file_.read() # now assign long_description=long_description below 24 | except IOError: # file not found 25 | warnings.warn("readme.md file not found") 26 | else: 27 | try: 28 | with open('readme.txt') as file: 29 | long_description = file.read() # now assign long_description=long_description below 30 | except IOError: # file not found 31 | pass 32 | 33 | setup(name='comocma', 34 | long_description=long_description, # __doc__ 35 | version=__version__.split()[0], 36 | description= "Multiobjective framework Sofomore, instantiated with " 37 | "the single-objective solver CMA-ES to obtain " 38 | "the Multiobjective evolutionary algorithm COMO-CMA-ES.", 39 | long_description_content_type = 'text/markdown', 40 | author="Cheikh Toure and Nikolaus Hansen", 41 | author_email="first_author_firstname.first_author_lastname@polytechnique.edu", 42 | # " second_author_firstname.second_author_lastname@inria.fr", 43 | # maintainer="Cheikh Toure and Nikolaus Hansen", 44 | # maintainer_email="first_author_firstname.first_author_lastname at polytechnique dot edu" + 45 | # " second_author_firstname.second_author_lastname at inria dot fr", 46 | url="https://github.com/CMA-ES/pycomocma", 47 | license="BSD", 48 | classifiers = [ 49 | "Intended Audience :: Science/Research", 50 | "Intended Audience :: Education", 51 | "Intended Audience :: Other Audience", 52 | "Topic :: Scientific/Engineering", 53 | "Topic :: Scientific/Engineering :: Mathematics", 54 | "Topic :: Scientific/Engineering :: Artificial Intelligence", 55 | "Operating System :: OS Independent", 56 | "Programming Language :: Python :: 2.7", 57 | "Programming Language :: Python :: 3", 58 | "Development Status :: 4 - Beta", 59 | "Environment :: Console", 60 | "License :: OSI Approved :: BSD License", 61 | ], 62 | keywords=["optimization", "multi-objective", "CMA-ES", "cmaes", "evolution strategy",], 63 | packages = ['comocma'], 64 | install_requires=["cma>=3", "moarchiving", "numpy"], 65 | package_data={'': ['LICENSE']}, 66 | ) 67 | 68 | --------------------------------------------------------------------------------