diff --git a/pymoo/algorithms/soo/nonconvex/es.py b/pymoo/algorithms/soo/nonconvex/es.py index 6a0afee2..d3363af3 100644 --- a/pymoo/algorithms/soo/nonconvex/es.py +++ b/pymoo/algorithms/soo/nonconvex/es.py @@ -1,4 +1,5 @@ import numpy as np +import math from pymoo.algorithms.base.genetic import GeneticAlgorithm from pymoo.algorithms.soo.nonconvex.ga import FitnessSurvival @@ -43,9 +44,9 @@ def __init__(self, """ if pop_size is None and n_offsprings is not None: - pop_size = int(np.math.ceil(n_offsprings * rule)) + pop_size = int(math.ceil(n_offsprings * rule)) elif n_offsprings is None and pop_size is not None: - n_offsprings = int(np.math.floor(pop_size / rule)) + n_offsprings = int(math.floor(pop_size / rule)) assert pop_size is not None and n_offsprings is not None, "You have to at least provivde pop_size of n_offsprings." assert n_offsprings >= 2 * pop_size, "The number of offsprings should be at least double the population size." diff --git a/pymoo/util/mnn.py b/pymoo/util/mnn.py index 39aa6327..47d6f013 100644 --- a/pymoo/util/mnn.py +++ b/pymoo/util/mnn.py @@ -40,7 +40,7 @@ def calc_mnn_base(X, n_remove=0, twonn=False): D = squareform(pdist(X, metric="sqeuclidean")) Dnn = np.partition(D, range(1, M+1), axis=1)[:, 1:M+1] - d = np.product(Dnn, axis=1) + d = np.prod(Dnn, axis=1) d[extremes] = np.inf n_removed = 0 @@ -63,7 +63,7 @@ def calc_mnn_base(X, n_remove=0, twonn=False): D[:, k] = np.inf Dnn[H] = np.partition(D[H], range(1, M+1), axis=1)[:, 1:M+1] - d[H] = np.product(Dnn[H], axis=1) + d[H] = np.prod(Dnn[H], axis=1) d[extremes] = np.inf return d diff --git a/setup.py b/setup.py index 2cc85a0a..9e7b7fac 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ 'scipy>=1.1', 'matplotlib>=3', 'autograd>=1.4', - 'cma==3.2.2', + 'cma>=3.2.2', 'alive-progress', 'dill', 'Deprecated'],