def maximize(self, rng = None):

        # All stdout and stderr is pointed to devnull during
        # the optimization. (That is the only way to keep cmaes quiet)
        if rng is None:
            rng = np.random.RandomState(42)
        if not self.verbose:
            sys.stdout = os.devnull
            sys.stderr = os.devnull
        res = cma.fmin(self._cma_fkt_wrapper(self.objective_func),
                x0=(self.X_upper + self.X_lower) * 0.5, sigma0=0.6,
                restarts=self.restarts,
                options={"bounds": [self.X_lower, self.X_upper],
                         "verbose": 0,
                         "verb_log": sys.maxsize,
                         "maxfevals": self.n_func_evals})
        if res[0] is None:
            logging.error("CMA-ES did not find anything. \
                Return random configuration instead.")
            return np.array([rng.uniform(self.X_lower,
                                               self.X_upper,
                                               self.X_lower.shape[0])])
        if not self.verbose:
            sys.stdout = sys.__stdout__
            sys.stderr = sys.__stderr__

        return np.array([res[0]])
Performs type-based annotation on a single token.
dataset/ETHPy150Open automl/RoBO/robo/maximizers/cmaes.py/CMAES.maximize--crossover with--dataset/ETHPy150Open reefeed/wanish/wanish/tokenizers.py/PunktBaseClass._first_pass_annotation