pymoo 0.6.1__cp311-cp311-macosx_10_9_universal2.whl → 0.6.1.2__cp311-cp311-macosx_10_9_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pymoo might be problematic. Click here for more details.
- pymoo/algorithms/moo/age.py +3 -2
- pymoo/algorithms/moo/nsga3.py +1 -2
- pymoo/algorithms/moo/sms.py +4 -1
- pymoo/algorithms/soo/nonconvex/cmaes.py +1 -1
- pymoo/algorithms/soo/nonconvex/es.py +1 -1
- pymoo/algorithms/soo/nonconvex/optuna.py +1 -4
- pymoo/algorithms/soo/nonconvex/pattern.py +1 -1
- pymoo/constraints/adaptive.py +2 -2
- pymoo/constraints/eps.py +1 -1
- pymoo/core/algorithm.py +1 -0
- pymoo/core/individual.py +512 -49
- pymoo/core/plot.py +1 -1
- pymoo/core/result.py +3 -0
- pymoo/core/variable.py +310 -16
- pymoo/cython/calc_perpendicular_distance.cpython-311-darwin.so +0 -0
- pymoo/cython/decomposition.cpython-311-darwin.so +0 -0
- pymoo/cython/hv.cpython-311-darwin.so +0 -0
- pymoo/cython/info.cpython-311-darwin.so +0 -0
- pymoo/cython/mnn.cpython-311-darwin.so +0 -0
- pymoo/cython/non_dominated_sorting.cpython-311-darwin.so +0 -0
- pymoo/cython/pruning_cd.cpython-311-darwin.so +0 -0
- pymoo/cython/stochastic_ranking.cpython-311-darwin.so +0 -0
- pymoo/gradient/__init__.py +3 -1
- pymoo/gradient/grad_autograd.py +28 -4
- pymoo/operators/crossover/sbx.py +1 -1
- pymoo/util/display/single.py +1 -2
- pymoo/util/function_loader.py +31 -21
- pymoo/util/nds/dominance_degree_non_dominated_sort.py +159 -0
- pymoo/util/ref_dirs/__init__.py +2 -0
- pymoo/util/ref_dirs/energy.py +4 -5
- pymoo/util/ref_dirs/energy_layer.py +5 -4
- pymoo/util/ref_dirs/incremental.py +68 -0
- pymoo/version.py +1 -1
- {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/METADATA +2 -3
- {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/RECORD +38 -36
- {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/WHEEL +1 -1
- {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/LICENSE +0 -0
- {pymoo-0.6.1.dist-info → pymoo-0.6.1.2.dist-info}/top_level.txt +0 -0
pymoo/algorithms/moo/age.py
CHANGED
|
@@ -167,7 +167,7 @@ class AGEMOEASurvival(Survival):
|
|
|
167
167
|
p = self.compute_geometry(front, extreme, n)
|
|
168
168
|
|
|
169
169
|
nn = np.linalg.norm(front, p, axis=1)
|
|
170
|
-
distances = self.pairwise_distances(front, p) / nn[:, None]
|
|
170
|
+
distances = self.pairwise_distances(front, p) / (nn[:, None])
|
|
171
171
|
|
|
172
172
|
neighbors = 2
|
|
173
173
|
remaining = np.arange(m)
|
|
@@ -284,7 +284,7 @@ def normalize(front, extreme):
|
|
|
284
284
|
|
|
285
285
|
try:
|
|
286
286
|
hyperplane = np.linalg.solve(front[extreme], np.ones(n))
|
|
287
|
-
if any(np.isnan(hyperplane)) or any(np.isinf(hyperplane)) or any(hyperplane
|
|
287
|
+
if any(np.isnan(hyperplane)) or any(np.isinf(hyperplane)) or any(hyperplane <= 0):
|
|
288
288
|
normalization = np.max(front, axis=0)
|
|
289
289
|
else:
|
|
290
290
|
normalization = 1. / hyperplane
|
|
@@ -300,4 +300,5 @@ def normalize(front, extreme):
|
|
|
300
300
|
|
|
301
301
|
return front, normalization
|
|
302
302
|
|
|
303
|
+
|
|
303
304
|
parse_doc_string(AGEMOEA.__init__)
|
pymoo/algorithms/moo/nsga3.py
CHANGED
|
@@ -278,7 +278,6 @@ class HyperplaneNormalization:
|
|
|
278
278
|
self.extreme_points = None
|
|
279
279
|
|
|
280
280
|
def update(self, F, nds=None):
|
|
281
|
-
|
|
282
281
|
# find or usually update the new ideal point - from feasible solutions
|
|
283
282
|
self.ideal_point = np.min(np.vstack((self.ideal_point, F)), axis=0)
|
|
284
283
|
self.worst_point = np.max(np.vstack((self.worst_point, F)), axis=0)
|
|
@@ -296,7 +295,7 @@ class HyperplaneNormalization:
|
|
|
296
295
|
worst_of_front = np.max(F[nds, :], axis=0)
|
|
297
296
|
|
|
298
297
|
self.nadir_point = get_nadir_point(self.extreme_points, self.ideal_point, self.worst_point,
|
|
299
|
-
|
|
298
|
+
worst_of_front, worst_of_population)
|
|
300
299
|
|
|
301
300
|
|
|
302
301
|
def get_extreme_points_c(F, ideal_point, extreme_points=None):
|
pymoo/algorithms/moo/sms.py
CHANGED
|
@@ -137,7 +137,7 @@ class SMSEMOA(GeneticAlgorithm):
|
|
|
137
137
|
pop_size=100,
|
|
138
138
|
sampling=FloatRandomSampling(),
|
|
139
139
|
selection=TournamentSelection(func_comp=cv_and_dom_tournament),
|
|
140
|
-
crossover=SBX(
|
|
140
|
+
crossover=SBX(),
|
|
141
141
|
mutation=PM(),
|
|
142
142
|
survival=LeastHypervolumeContributionSurvival(),
|
|
143
143
|
eliminate_duplicates=True,
|
|
@@ -184,6 +184,9 @@ class SMSEMOA(GeneticAlgorithm):
|
|
|
184
184
|
# merge the offsprings with the current population
|
|
185
185
|
if infills is not None:
|
|
186
186
|
pop = Population.merge(self.pop, infills)
|
|
187
|
+
else:
|
|
188
|
+
pop = self.pop
|
|
189
|
+
|
|
187
190
|
|
|
188
191
|
self.pop = self.survival.do(self.problem, pop, n_survive=self.pop_size, algorithm=self,
|
|
189
192
|
ideal=ideal, nadir=nadir, **kwargs)
|
|
@@ -402,7 +402,7 @@ class CMAES(LocalSearch):
|
|
|
402
402
|
self.norm = NoNormalization()
|
|
403
403
|
self.options['bounds'] = [xl, xu]
|
|
404
404
|
|
|
405
|
-
self.options['seed'] = self.seed
|
|
405
|
+
self.options['seed'] = kwargs.get('seed', self.seed)
|
|
406
406
|
|
|
407
407
|
if isinstance(self.termination, MaximumGenerationTermination):
|
|
408
408
|
self.options['maxiter'] = self.termination.n_max_gen
|
|
@@ -45,7 +45,7 @@ class ES(GeneticAlgorithm):
|
|
|
45
45
|
if pop_size is None and n_offsprings is not None:
|
|
46
46
|
pop_size = int(np.math.ceil(n_offsprings * rule))
|
|
47
47
|
elif n_offsprings is None and pop_size is not None:
|
|
48
|
-
n_offsprings = int(np.math.floor(
|
|
48
|
+
n_offsprings = int(np.math.floor(pop_size / rule))
|
|
49
49
|
|
|
50
50
|
assert pop_size is not None and n_offsprings is not None, "You have to at least provivde pop_size of n_offsprings."
|
|
51
51
|
assert n_offsprings >= 2 * pop_size, "The number of offsprings should be at least double the population size."
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
|
|
3
|
-
from optuna.logging import get_logger
|
|
4
|
-
|
|
5
1
|
from pymoo.util.optimum import filter_optimum
|
|
6
2
|
|
|
7
3
|
try:
|
|
8
4
|
import optuna
|
|
9
5
|
from optuna.samplers import TPESampler
|
|
6
|
+
from optuna.logging import get_logger
|
|
10
7
|
except:
|
|
11
8
|
raise Exception("Please install optuna: pip install optuna")
|
|
12
9
|
|
|
@@ -80,7 +80,7 @@ class PatternSearch(LocalSearch):
|
|
|
80
80
|
def _next(self):
|
|
81
81
|
|
|
82
82
|
# whether the last iteration has resulted in a new optimum or not
|
|
83
|
-
has_improved = is_better(self._explr, self._center
|
|
83
|
+
has_improved = is_better(self._explr, self._center)
|
|
84
84
|
|
|
85
85
|
# that means that the exploration did not find any new point and was thus unsuccessful
|
|
86
86
|
if not has_improved:
|
pymoo/constraints/adaptive.py
CHANGED
|
@@ -40,7 +40,7 @@ class AdaptiveConstraintHandling(Meta, Algorithm):
|
|
|
40
40
|
def _setup(self, _, **kwargs):
|
|
41
41
|
self.evaluator = AttachConfigEvaluator(self.evaluator, self.config)
|
|
42
42
|
|
|
43
|
-
def
|
|
43
|
+
def _adapt_constraint_handling(self, config, infills=None, **kwargs):
|
|
44
44
|
pass
|
|
45
45
|
|
|
46
46
|
def _initialize_advance(self, infills=None, **kwargs):
|
|
@@ -53,7 +53,7 @@ class AdaptiveConstraintHandling(Meta, Algorithm):
|
|
|
53
53
|
super()._advance(infills=infills, **kwargs)
|
|
54
54
|
copy_to_dict(self.default_config, self.config)
|
|
55
55
|
|
|
56
|
-
self.
|
|
56
|
+
self._adapt_constraint_handling(self.adapted_config, infills=infills, **kwargs)
|
|
57
57
|
|
|
58
58
|
def _infill(self):
|
|
59
59
|
copy_to_dict(self.adapted_config, self.config)
|
pymoo/constraints/eps.py
CHANGED
|
@@ -10,7 +10,7 @@ class AdaptiveEpsilonConstraintHandling(AdaptiveConstraintHandling):
|
|
|
10
10
|
self.perc_eps_until = perc_eps_until
|
|
11
11
|
self.max_cv = None
|
|
12
12
|
|
|
13
|
-
def
|
|
13
|
+
def _adapt_constraint_handling(self, config, **kwargs):
|
|
14
14
|
t = self.termination.perc
|
|
15
15
|
alpha = np.maximum(0.0, 1 - 1 / self.perc_eps_until * t)
|
|
16
16
|
eps = alpha * self.max_cv
|