Skip to content

Instantly share code, notes, and snippets.

@avisheknag17
Created June 12, 2021 18:53
Show Gist options
  • Save avisheknag17/68846a23190f42bb76113d376c8566ff to your computer and use it in GitHub Desktop.
Save avisheknag17/68846a23190f42bb76113d376c8566ff to your computer and use it in GitHub Desktop.
def _acquisition_function(self, x):
return -self._get_expected_improvement(x)
def _get_next_probable_point(self):
min_ei = float(sys.maxsize)
x_optimal = None
# Trial with an array of random data points
for x_start in (np.random.random((self.batch_size,self.x_init.shape[1])) * self.scale):
response = minimize(fun=self._acquisition_function, x0=x_start, method='L-BFGS-B')
if response.fun[0] < min_ei:
min_ei = response.fun[0]
x_optimal = response.x
return x_optimal, min_ei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment