I'm using Pymoo in order to run an optimization problem (using NSGA2). When I run the algorithm with no termination condition, like so:
res = minimize(problem,
algorithm,
('n_gen',5000),
verbose = True,
seed = 42)
The optimization runs until 5000 generations, even though it does seem to converge faster than that. I attempted this change instead:
#Default termination:
termination = DefaultMultiObjectiveTermination(
xtol=1e-8,
cvtol=1e-6,
ftol=0.0025,
period=30,
n_max_gen=1000,
n_max_evals=100000
)
res = minimize(problem,
algorithm,
termination,
verbose = True,
seed = 42)
But however much I change xtol, cvtol, or ftol the problem terminates during the 7th generation, and returns this error: AxisError: axis 1 is out of bounds for array of dimension 1 I'm not sure if this is to inform me that the problem converged by generation 7, or if there is an actual error involved. Keep in mind that the optimization does not return any error whatsoever in my first case when I don't have an explicit termination conditioned defined, and so the issue shouldn't be with the way I defined my optimization problem.