def test_13_high_sobol(self): """Test init of high-dimensional sobol sequences""" def f(x): return 0 bounds = [(None, None), ] * 41 SHGOc = SHGO(f, bounds, sampling_method='sobol') SHGOc.sobol_points(2, 50)
def test_7_2_minkwargs(self): """Test the minimizer_kwargs default inits""" minimizer_kwargs = {'ftol': 1e-5} options = {'disp': True} # For coverage purposes SHGOc = SHGO(test3_1.f, test3_1.bounds, constraints=test3_1.cons[0], minimizer_kwargs=minimizer_kwargs, options=options)
def _call_maximizer_shgo(self, bounds): """ Maximizes Objective Function with the SHGO Optimizer :param bounds: Boundary of the current Alpha Level :return: Maximum """ if self.optimizer == 'sobol': return SHGO(self._max_function_value, bounds=bounds, n=self.n, iters=self.iters, sampling_method=self.optimizer, options={'ftol': 1e-4}, constraints=None) else: return SHGO(self._max_function_value, bounds=bounds, n=self.n, iters=self.iters, options={'ftol': 1e-4}, constraints=None)
def test_9_cons_g(self): """Test single function constraint passing""" SHGOc = SHGO(test3_1.f, test3_1.bounds, constraints=test3_1.cons[0])