MCPcopy Create free account
hub / github.com/bayesian-optimization/BayesianOptimization / _update_gains

Method _update_gains

bayes_opt/acquisition.py:1238–1250  ·  view source on GitHub ↗

Update the gains of the base acquisition functions. Parameters ---------- gp : GaussianProcessRegressor A fitted Gaussian Process.

(self, gp: GaussianProcessRegressor)

Source from the content-addressed store, hash-verified

1236 return np.argmax(r <= cumsum_softmax_g) # Returns the first True value
1237
1238 def _update_gains(self, gp: GaussianProcessRegressor) -> None:
1239 """Update the gains of the base acquisition functions.
1240
1241 Parameters
1242 ----------
1243 gp : GaussianProcessRegressor
1244 A fitted Gaussian Process.
1245 """
1246 with warnings.catch_warnings():
1247 warnings.simplefilter("ignore")
1248 rewards = gp.predict(self.previous_candidates)
1249 self.gains += rewards
1250 self.previous_candidates = None
1251
1252 def suggest(
1253 self,

Callers 3

suggestMethod · 0.95

Calls 1

predictMethod · 0.45

Tested by 2