Created
June 12, 2021 18:53
-
-
Save avisheknag17/68846a23190f42bb76113d376c8566ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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