def max_compute(self, y_max, bounds, n_warmup=<NUM_LIT>, n_iter=<NUM_LIT>):
<EOL>x_tries = self.random_generator.uniform(bounds[:, <NUM_LIT:0>], bounds[:, <NUM_LIT:1>],<EOL>size=(n_warmup, bounds.shape[<NUM_LIT:0>]))<EOL>ys = self.compute(x_tries, y_max=y_max)<EOL>x_max = x_tries[ys.argmax()]<EOL>max_acq = ys.max()<EOL>x_seeds = self.random_generator.uniform(bounds[:, <NUM_LIT:0>], bounds[:, <NUM_LIT:1>],<EOL>size=(n_iter, bounds.shape[<NUM_LIT:0>]))<EOL>for x_try in x_seeds:<EOL><INDENT>res = minimize(lambda x: -self.compute(x.reshape(<NUM_LIT:1>, -<NUM_LIT:1>), y_max=y_max),<EOL>x_try.reshape(<NUM_LIT:1>, -<NUM_LIT:1>),<EOL>bounds=bounds,<EOL>method="<STR_LIT>")<EOL>if not res.success:<EOL><INDENT>continue<EOL><DEDENT>if max_acq is None or -res.fun[<NUM_LIT:0>] >= max_acq:<EOL><INDENT>x_max = res.x<EOL>max_acq = -res.fun[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>return np.clip(x_max, bounds[:, <NUM_LIT:0>], bounds[:, <NUM_LIT:1>])<EOL>
A function to find the maximum of the acquisition function

        It uses a combination of random sampling (cheap) and the 'L-BFGS-B' optimization method.

        First by sampling `n_warmup` (1e5) points at random,
        and then running L-BFGS-B from `n_iter` (250) random starting points.

        Params:
            y_max: The current maximum known value of the target function.
            bounds: The variables bounds to limit the search of the acq max.
            n_warmup: The number of times to randomly sample the acquisition function
            n_iter: The number of times to run scipy.minimize

        Returns
            x_max: The arg max of the acquisition function.