in nevergrad/optimization/optimizerlib.py [0:0]
def _select_optimizer_cls(self) -> base.OptCls:
# Extracting info as far as possible.
assert self.budget is not None
funcinfo = self.parametrization.function
optimClass: base.OptCls
if self.has_noise and (self.has_discrete_not_softmax or not funcinfo.metrizable):
if self.budget > 10000:
optimClass = RecombiningPortfolioOptimisticNoisyDiscreteOnePlusOne
else:
optimClass = ParametrizedOnePlusOne(
crossover=True, mutation="discrete", noise_handling="optimistic"
)
elif self._arity > 0:
if self.budget < 1000 and self.num_workers == 1:
optimClass = DiscreteBSOOnePlusOne
elif self.num_workers > 2:
optimClass = CMandAS2 # type: ignore
else:
optimClass = super()._select_optimizer_cls()
else:
if (
not (self.has_noise and self.fully_continuous and self.dimension > 100)
and not (self.has_noise and self.fully_continuous)
and not (self.num_workers > self.budget / 5)
and (self.num_workers == 1 and self.budget > 6000 and self.dimension > 7)
and self.num_workers < self.budget
):
optimClass = ChainMetaModelPowell
else:
optimClass = super()._select_optimizer_cls()
return optimClass