QDpy
Loading...
Searching...
No Matches
bayesian.py
Go to the documentation of this file.
1# SPDX-License-Identifier: LGPL-3.0-or-later
2
4
5"""BOP-Elites for fixed, low-dimensional descriptor grids."""
6
7from math import isfinite, sqrt
8import random
9
10import numpy as np
11from scipy.linalg import solve_triangular
12from scipy.optimize import minimize
13from scipy.special import ndtr, ndtri
14from scipy.stats import qmc
15from sklearn.calibration import CalibratedClassifierCV
16from sklearn.gaussian_process import GaussianProcessRegressor
17from sklearn.gaussian_process.kernels import Matern
18from sklearn.model_selection import StratifiedKFold
19from sklearn.svm import SVC
20
21from qdpy.base import registry
22from qdpy.containers import Grid, ParetoGrid
23from .modern import _FixedGeneration, _bounds, _positive_int
24
25__all__ = ["BOPElites", "BayesianParetoIllumination"]
26
27
28def _expected_improvement(mean, deviation, target):
29 gain = mean - target
30 z = np.divide(gain, deviation, out=np.zeros_like(gain), where=deviation > 0)
31 ei = gain * ndtr(z) + deviation * np.exp(-0.5 * z ** 2) / sqrt(2 * np.pi)
32 return np.where(deviation > 0, np.maximum(ei, 0), np.maximum(gain, 0))
33
34
35def _region_probabilities(mean, deviation, lower, upper, closed):
36 low_delta, high_delta = lower - mean, upper - mean
37 z_lower = np.divide(low_delta, deviation, out=np.zeros_like(low_delta), where=deviation > 0)
38 z_upper = np.divide(high_delta, deviation, out=np.zeros_like(high_delta), where=deviation > 0)
39 # Evaluate the upper tail by symmetry to avoid subtracting numbers near one.
40 mass = np.where(z_lower >= 0, ndtr(-z_lower) - ndtr(-z_upper), ndtr(z_upper) - ndtr(z_lower))
41 point = (mean >= lower) & ((mean < upper) | (closed & (mean == upper)))
42 return np.prod(np.where(deviation > 0, mass, point), axis=-1)
43
44
45def _joint_improvement(probability, improvement, cutoff):
46 if cutoff is None:
47 return probability * improvement
48 weights = np.where(probability > cutoff, probability, 0)
49 total = weights.sum(axis=-1, keepdims=True)
50 weights = np.divide(weights, total, out=weights, where=total > 0)
51 return weights * improvement
52
53
55 """Share the fitted input geometry of independent, fixed-kernel GPs."""
56
57 @classmethod
58 def of(cls, models):
59 if not models or not all(
60 type(model) is GaussianProcessRegressor and type(getattr(model, "kernel_", None)) is Matern
61 and np.isscalar(getattr(model, "_y_train_mean", None))
62 and np.isscalar(getattr(model, "_y_train_std", None))
63 and model.alpha_.ndim == 1 for model in models
64 ):
65 return models
66 first = models[0]
67 if all(np.array_equal(model.X_train_, first.X_train_)
68 and np.array_equal(model.kernel_.theta, first.kernel_.theta)
69 and model.kernel_.nu == first.kernel_.nu
70 and np.array_equal(model.L_, first.L_) for model in models[1:]):
71 return cls(models)
72 return models
73
74
75 def predict(self, points):
76 """Return response columns, or defer to the individual predictors."""
77 first = self[0]
78 if (type(points) is not np.ndarray or points.ndim != 2 or not len(points)
79 or points.dtype != np.float64 or points.shape[1] != first.X_train_.shape[1]
80 or not np.isfinite(points).all()):
81 return None
82 kernel = first.kernel_(points, first.X_train_)
83 triangle = solve_triangular(first.L_, kernel.T, lower=True, check_finite=False)
84 variance = first.kernel_.diag(points).copy()
85 variance -= np.einsum("ij,ji->i", triangle.T, triangle)
86 if np.any(variance < 0):
87 # Preserve the individual predictors' numerical warning and correction.
88 return None
89 means, deviations = [], []
90 for model in self:
91 # Keep scikit-learn's per-target matvec and scaling arithmetic.
92 means.append(model._y_train_std * (kernel @ model.alpha_) + model._y_train_mean)
93 deviations.append(np.sqrt(np.outer(variance, model._y_train_std**2).ravel()))
94 return np.asarray(means).T, np.asarray(deviations).T
95
96
97
98@registry.register
100 """Fit independent objective and descriptor Gaussian processes after each observation.
101
102 A scrambled Sobol sequence supplies initial points and acquisition
103 restarts. The result grid contains genuine evaluations. Surrogates include
104 finite observations that did not improve an elite or fell outside the grid.
105 Powell search is bounded to the supplied decision domain.
106
107 With feasibility modelling enabled, return
108 ``(None, None, {"bop_valid": False})`` for a known infeasible design.
109 Unsuccessful calls without explicit infeasibility teach neither the
110 quality models nor the feasibility model.
111
112 With a descriptor transform, return the measured sources as
113 ``(fitness, None, {"bop_latents": values})``. The same transform sets
114 measured descriptors and projects posterior samples during acquisition.
115
116 :param container: One-elite Grid with one or two descriptor axes.
117 :param budget: Maximum number of genuine evaluation attempts per run.
118 :param dimension: Number of continuous decision coordinates.
119 :param ind_domain: Common lower and upper decision bounds.
120 :param quality_floor: Empty-cell comparison value in signed quality units.
121 :param initial_samples: Number of Sobol proposals before modelling, default
122 ten times the decision dimension.
123 :param candidate_pool: Number of Sobol points scored at each modelled step.
124 :param restarts: Maximum number of local acquisition searches per step.
125 :param seed: Optional seed for the Sobol sequence.
126 :param model_feasibility: Weight acquisition by a calibrated SVM after
127 at least three valid and three explicitly infeasible observations.
128 :param descriptor_transform: Optional vectorized function of two arrays,
129 raw genomes and measured or predicted latent rows. Return one
130 descriptor row per input row. Use ordinary Grid features.
131 :param latent_size: Number of measured source values when a transform is set.
132 :param posterior_samples: Power-of-two number of shared normal draws for
133 joint descriptor probabilities.
134 """
135
136 _requires_proposed_genome = True
137 _bop_batch_size = 1
138 # Defaults also cover archives loaded from older BOPElites pickles.
139 model_feasibility = False
140 descriptor_transform = None
141 _feasibility_model = None
142 _explicit_invalid = False
143
144 @staticmethod
145 def _validate_grid(container):
146 if (type(container) is not Grid or len(container.shape) not in (1, 2)
147 or container.max_items_per_bin != 1 or len(container.fitness_domain) != 1):
148 raise ValueError("BOPElites requires a one-elite Grid for one objective and one or two descriptors.")
149
150 def __init__(self, container, budget, dimension, ind_domain, quality_floor, *,
151 initial_samples=None, candidate_pool=128, restarts=8, seed=None,
152 model_feasibility=False, descriptor_transform=None, latent_size=None,
153 posterior_samples=256, **kwargs):
154 self._validate_grid(container)
155 lower, upper = np.asarray(container.features_domain, dtype=float).T
156 if len(lower) != len(container.shape) or not np.all(np.isfinite([lower, upper])) or np.any(lower >= upper):
157 raise ValueError("Provide finite increasing bounds for each descriptor axis.")
158 if not isfinite(quality_floor):
159 raise ValueError("quality_floor must be finite.")
160
161 dimension = _positive_int(dimension, "dimension")
162 self.ind_domain = _bounds(ind_domain)
163 self.quality_floor = quality_floor
164 self.initial_samples = 10 * dimension if initial_samples is None else _positive_int(initial_samples, "initial_samples")
165 self.candidate_pool = _positive_int(candidate_pool, "candidate_pool")
166 self.restarts = _positive_int(restarts, "restarts")
167 self.seed = seed
168 self.model_feasibility = model_feasibility
169 self.descriptor_transform = descriptor_transform
170 if descriptor_transform is not None:
171 if not callable(descriptor_transform) or container.features_score_names:
172 raise ValueError("Use a callable descriptor transform with ordinary grid features.")
173 self.latent_size = _positive_int(latent_size, "latent_size")
174 self.posterior_samples = _positive_int(posterior_samples, "posterior_samples")
175 if self.posterior_samples & (self.posterior_samples - 1):
176 raise ValueError("posterior_samples must be a power of two.")
177 elif latent_size is not None:
178 raise ValueError("latent_size requires a descriptor transform.")
179 self._cells = tuple(container.solutions)
180 cells = np.asarray(self._cells)
181 width = (upper - lower) / np.asarray(container.shape)
182 if descriptor_transform is not None:
183 if np.any(width <= 0) or not np.isfinite(width).all():
184 raise ValueError("The grid needs finite positive cell widths.")
185 self._descriptor_bounds = lower, upper, width
186 self._region_lower = lower + cells * width
187 self._closed_upper = cells == np.asarray(container.shape) - 1
188 self._region_upper = np.where(self._closed_upper, upper, lower + (cells + 1) * width)
189 super().__init__(container, _positive_int(budget, "budget"), batch_size=self._bop_batch_size,
190 dimension=dimension, **kwargs)
191
192 def reinit(self):
193 """Reset the Sobol stream, observations, and acquisition counters."""
194 super().reinit()
195 self._sobol = None
196 self._seen = set()
197 self._observations = []
198 self._misclassified = 0
199 self._all_cut_off = 0
200 self._prediction_cell = None
201 self._unit_candidate = None
202 self._posterior_normals = None
203 self._validity = []
204 self._feasibility_model = None
205 self._explicit_invalid = False
206 self._reported_latents = None
207
208 @property
209 def n_observations(self):
210 """Number of finite observations available to the models."""
211 return len(self._observations)
212
213 @property
214 def n_invalid_observations(self):
215 """Number of explicit infeasibility labels received in this run."""
216 return len(self._validity) - self.n_observations if self.model_feasibility else 0
217
218 def _sobol_point(self):
219 if self._sobol is None:
220 seed = random.randrange(2**32) if self.seed is None else self.seed
221 self._sobol = qmc.Sobol(self.dimension, scramble=True, seed=seed)
222 for _ in range(1024):
223 point = self._sobol.random(1)[0]
224 if tuple(self._raw_point(point)) not in self._seen:
225 return point
226 raise RuntimeError("The Sobol stream could not find an unseen genome in the decision bounds.")
227
228 def _raw_point(self, point):
229 lower, upper = self.ind_domain
230 return lower + point * (upper - lower)
231
232 def _fit_models(self):
233 points = np.asarray([point for point, _ in self._observations])
234 targets = np.asarray([target for _, target in self._observations])
235 models = []
236 for column in targets.T:
237 kernel = Matern(length_scale=[0.25] * self.dimension, nu=2.5)
238 model = GaussianProcessRegressor(kernel=kernel, alpha=1e-6, normalize_y=True, optimizer=None)
239 models.append(model.fit(points, column))
240 return _SharedGaussianProcesses.of(models)
241
242 def _fit_feasibility(self):
243 if min(self.n_invalid_observations, self.n_observations) < 3:
244 return None
245 points, valid = zip(*self._validity)
246 folds = StratifiedKFold(n_splits=3, shuffle=True, random_state=0)
247 model = CalibratedClassifierCV(SVC(), method="sigmoid", cv=folds, ensemble=False)
248 return model.fit(np.asarray(points), np.asarray(valid, dtype=int))
249
250 def _descriptors(self, genomes, latents):
251 descriptors = np.asarray(self.descriptor_transform(genomes, latents), dtype=float)
252 if descriptors.shape != (len(genomes), len(self.container.shape)) or not np.isfinite(descriptors).all():
253 raise ValueError("The descriptor transform must return one finite descriptor vector per row.")
254 return descriptors
255
256 def _structured_probabilities(self, points, means, deviations):
257 if self._posterior_normals is None:
258 seed = random.randrange(2**32) if self.seed is None else self.seed
259 stream = np.random.SeedSequence(seed).spawn(1)[0]
260 sobol = qmc.Sobol(self.latent_size, scramble=True, seed=np.random.default_rng(stream))
261 unit = sobol.random_base2(self.posterior_samples.bit_length() - 1)
262 eps = np.finfo(float).eps
263 self._posterior_normals = ndtri(np.clip(unit, eps, 1. - eps))
264
265 samples = means[:, None, :] + deviations[:, None, :] * self._posterior_normals
266 genomes = np.repeat(self._raw_point(points), self.posterior_samples, axis=0)
267 descriptors = self._descriptors(genomes, samples.reshape(-1, self.latent_size))
268 lower, upper, width = self._descriptor_bounds
269 inside = np.all((descriptors >= lower) & (descriptors <= upper), axis=1)
270 shape = np.asarray(self.container.shape)
271 indices = np.minimum(shape - 1, ((descriptors[inside] - lower) / width).astype(np.intp))
272 flat_cells = np.ravel_multi_index(indices.T, self.container.shape)
273 point_ids = np.flatnonzero(inside) // self.posterior_samples
274 column_count = len(self._cells)
275 counts = np.bincount(point_ids * column_count + flat_cells, minlength=len(points) * column_count)
276 probabilities = counts.reshape(len(points), column_count) / self.posterior_samples
277 draws = descriptors.reshape(len(points), self.posterior_samples, -1)
278 locations = draws.mean(axis=1)
279 deterministic = np.all(deviations == 0., axis=1)
280 locations[deterministic] = draws[deterministic, 0]
281 return probabilities, locations
282
283 def _thresholds(self):
284 thresholds = []
285 for cell in self._cells:
286 front = self.container.solutions[cell]
287 if front:
288 fitness = self.container.get_ind_fitness(front[0])
289 thresholds.append(fitness.values[0] * fitness.weights[0])
290 else:
291 thresholds.append(self.quality_floor)
292 return np.array(thresholds)
293
294 def _posterior(self, models, points):
295 prediction = models.predict(points) if type(models) is _SharedGaussianProcesses else None
296 if prediction is None:
297 predictions = [model.predict(points, return_std=True) for model in models]
298 means = np.asarray([mean for mean, _ in predictions]).T
299 deviations = np.asarray([deviation for _, deviation in predictions]).T
300 return means, deviations
301 return prediction
302
303 def _acquisition(self, models, points, thresholds, cutoff):
304 means, deviations = self._posterior(models, points)
305 if self.descriptor_transform is None:
306 probabilities = _region_probabilities(
307 means[:, None, 1:], deviations[:, None, 1:], self._region_lower,
308 self._region_upper, self._closed_upper,
309 )
310 descriptor_means = means[:, 1:]
311 else:
312 probabilities, descriptor_means = self._structured_probabilities(
313 points, means[:, 1:], deviations[:, 1:])
314 improvement = _expected_improvement(means[:, :1], deviations[:, :1], thresholds)
315 contributions = _joint_improvement(probabilities, improvement, cutoff)
316 if self.descriptor_transform is not None and cutoff is not None:
317 # Keep the total probability of falling within the grid after truncation.
318 contributions *= probabilities.sum(axis=1, keepdims=True)
319 if self._feasibility_model is not None:
320 contributions *= self._feasibility_model.predict_proba(points)[:, 1, None]
321 return contributions, descriptor_means
322
323 def _predicted_cell(self, features):
324 try:
325 return self.container.index_grid(features)
326 except IndexError:
327 return None
328
329 def _probability_cutoff(self):
330 denominator = max(1, self.nb_evaluations + self._misclassified - 2 * self._all_cut_off)
331 return 0.5 * (2 / len(self._cells)) ** sqrt(10 * self.dimension / denominator)
332
333 def _modelled_point(self):
334 models = self._fit_models()
335 if self.model_feasibility:
337 thresholds = self._thresholds()
338 pool = np.asarray([self._sobol_point() for _ in range(self.candidate_pool)])
339 cutoff = self._probability_cutoff()
340 contributions, means = self._acquisition(models, pool, thresholds, cutoff)
341 if cutoff is not None and not np.any(contributions > 0):
342 self._all_cut_off += 1
343 cutoff = None
344 contributions, means = self._acquisition(models, pool, thresholds, cutoff)
345
346 values = contributions.sum(axis=1)
347 order = np.argsort(-values, kind="stable")
348 selected = int(order[0])
349 best = pool[selected]
350 best_value = values[selected]
351 best_contributions = contributions[selected]
352 visited = set()
353
354 def acquire(point):
355 regional = self._acquisition(models, point[None, :], thresholds, cutoff)[0][0]
356 return regional
357
358 for row in order:
359 predicted = self._predicted_cell(means[row])
360 if predicted in visited:
361 continue
362 visited.add(predicted)
363 candidate = minimize(lambda point: -float(acquire(point).sum()), pool[row], method="Powell",
364 bounds=[(0, 1)] * self.dimension, options={"maxiter": 8, "maxfev": 50}).x
365 candidate = np.clip(candidate, 0, 1)
366 if tuple(self._raw_point(candidate)) not in self._seen:
367 regional = acquire(candidate)
368 value = regional.sum()
369 if value > best_value:
370 best, best_value, best_contributions = candidate, value, regional
371 if len(visited) >= self.restarts:
372 break
373
374 region = int(np.argmax(best_contributions))
375 self._prediction_cell = self._cells[region] if best_contributions[region] > best_value / 2 else None
376 return best
377
378 def _internal_ask(self, base_ind):
379 self._explicit_invalid = False
380 self._reported_latents = None
381 if self.nb_suggestions < self.initial_samples or self.n_observations < 2:
382 self._unit_candidate = self._sobol_point()
383 self._prediction_cell = None
384 else:
385 self._unit_candidate = self._modelled_point()
386 # Key the proposed genome in raw coordinates. Distinct normalised
387 # floats can map to the same genome when the user chooses tight bounds.
388 base_ind[:] = self._raw_point(self._unit_candidate)
389 self._seen.add(tuple(base_ind))
390 return base_ind
391
392 def _check_candidate(self, individual):
393 self._check_measurements(individual)
394 if len(self.container.get_ind_features(individual)) != len(self.container.shape):
395 raise ValueError("Descriptor length must match the grid.")
396
397 def tell(self, individual, fitness=None, features=None, scores=None,
398 elapsed=None, verbose=False, tell_container=True):
399 """Stage a native result, including optional feasibility and source values."""
400 if self.model_feasibility or self.descriptor_transform is not None:
401 if not self._staging:
402 raise RuntimeError("Use tell_batch() to report a manual generation.")
403 if tuple(individual) != self._expected_genome:
404 raise ValueError("The evaluated genome differs from the proposal for this slot.")
405 metadata = individual.scores if scores is None else scores
406 if self.model_feasibility:
407 valid = metadata["bop_valid"] if "bop_valid" in metadata else True
408 if not isinstance(valid, (bool, np.bool_)):
409 raise ValueError("bop_valid must be a boolean.")
410 if not valid:
411 self._explicit_invalid = True
412 return False
413 if self.descriptor_transform is not None:
414 latents = np.asarray(metadata["bop_latents"], dtype=float)
415 if latents.shape != (self.latent_size,) or not np.isfinite(latents).all():
416 raise ValueError("bop_latents must contain one finite value per measured source.")
417 features = tuple(self._descriptors(np.asarray(individual, dtype=float)[None, :],
418 latents[None, :])[0])
419 self._reported_latents = tuple(latents)
420 return super().tell(individual, fitness, features, scores, elapsed, verbose, tell_container)
421
422 def _commit_generation(self, evaluated):
423 individual = evaluated[0]
424 if individual is None:
425 if self._explicit_invalid:
426 self._validity.append((self._unit_candidate.copy(), False))
427 return set()
428 archive = self.container
429 fitness = archive.get_ind_fitness(individual)
430 features = tuple(archive.get_ind_features(individual))
431 quality = fitness.values[0] * fitness.weights[0]
432 point = self._unit_candidate.copy()
433 sources = features if self.descriptor_transform is None else self._reported_latents
434 self._observations.append((point, (quality, *sources)))
435 if self.model_feasibility:
436 self._validity.append((point, True))
437 actual = self._predicted_cell(features)
438 if self._prediction_cell is not None and self._prediction_cell != actual:
439 self._misclassified += 1
440 if actual is None or not archive.in_bounds(fitness.values, archive.fitness_domain):
441 return set()
442 return {0} if self._offer_to_grid(individual, actual) else set()
443
444
445
446def _improvement_strips(front, reference):
447 left = reference[0]
448 strips = []
449 for x, y in sorted(set(map(tuple, front)), key=lambda point: (point[0], -point[1])):
450 if x > left:
451 strips.append((left, x, y))
452 left = x
453 strips.append((left, np.inf, reference[1]))
454 return np.asarray(strips)
455
456
457
458def _expected_hypervolume_improvement(means, deviations, strips):
459 left, right, bottom = strips.T
460 gain = _expected_improvement(means[:, :1], deviations[:, :1], left)
461 finite = np.isfinite(right)
462 gain[:, finite] -= _expected_improvement(means[:, :1], deviations[:, :1], right[finite])
463 height = _expected_improvement(means[:, 1:], deviations[:, 1:], bottom)
464 return np.sum(np.maximum(gain, 0.) * height, axis=1)
465
466
467
470@registry.register
472 """Sequential Bayesian illumination of measured two-objective Pareto fronts.
473
474 Fit independent fixed-kernel GP models for each objective and descriptor.
475 For each candidate, sum per-cell expected hypervolume improvement
476 multiplied by the probability of landing in that cell. Use actual
477 evaluations for Pareto admission. Finite evaluations outside the
478 archive bounds can still inform the models.
479
480 :param container: A crowding ParetoGrid with two objectives and one or two
481 descriptors. Use direct fitness and features.
482 :param budget: Number of true evaluation attempts.
483 :param dimension: Number of bounded real decision variables.
484 :param ind_domain: Shared finite decision bounds.
485 :param reference: Two raw objective coordinates weakly dominated by the
486 worst objective corner of the declared fitness domain.
487 :param initial_samples: Number of initial Sobol proposals.
488 :param candidate_pool: Sobol candidates screened per acquisition.
489 :param restarts: Maximum number of local acquisition refinements.
490 :param seed: Seed for the scrambled Sobol proposal stream.
491 """
492
493 @staticmethod
494 def _validate_grid(container):
495 if (type(container) is not ParetoGrid or len(container.shape) not in (1, 2)
496 or len(container.fitness_domain) != 2 or container.truncation != "crowding"
497 or container.fitness_score_names or container.features_score_names):
498 raise ValueError("Use a two-objective crowding ParetoGrid with one or two direct descriptors.")
499
500 def __init__(self, container, budget, dimension, ind_domain, *, reference,
501 initial_samples=None, candidate_pool=128, restarts=8, seed=0):
502 self._validate_grid(container)
503 direction = np.sign(container.fitness_weights)
504 ref = np.asarray(reference, dtype=float)
505 bounds = np.asarray(container.fitness_domain, dtype=float)
506 worst = np.where(direction > 0, bounds[:, 0], -bounds[:, 1])
507 if ref.shape != (2,) or not np.isfinite(ref).all() or not np.all(direction * ref <= worst):
508 raise ValueError("The finite reference point must be weakly dominated by the fitness domain.")
509 self.reference = tuple(ref)
510 self._direction = direction
511 self._signed_reference = direction * ref
512 super().__init__(container, budget, dimension, ind_domain, quality_floor=0.,
513 initial_samples=initial_samples, candidate_pool=candidate_pool, restarts=restarts,
514 seed=seed, optimisation_task=container.fitness_weights)
515
516 def _probability_cutoff(self):
517 return None
518
519 def _thresholds(self):
520 return [
521 _improvement_strips([self._direction * ind.fitness.values for ind in self.container.solutions[cell]],
523 for cell in self._cells
524 ]
525
526 def _acquisition(self, models, points, thresholds, cutoff):
527 means, deviations = self._posterior(models, points)
528 descriptors = means[:, 2:]
529 probabilities = _region_probabilities(
530 descriptors[:, None, :], deviations[:, None, 2:], self._region_lower,
531 self._region_upper, self._closed_upper)
532 improvement = np.column_stack([
533 _expected_hypervolume_improvement(means[:, :2], deviations[:, :2], strips)
534 for strips in thresholds
535 ])
536 return probabilities * improvement, descriptors
537
538 def _check_candidate(self, individual):
539 super()._check_candidate(individual)
540 if len(individual.fitness.values) != 2:
541 raise ValueError("Supply exactly two measured objectives.")
542
543 def _commit_generation(self, evaluated):
544 individual = evaluated[0]
545 if individual is None:
546 return set()
547 fitness, features = individual.fitness.values, tuple(individual.features)
548 self._observations.append((self._unit_candidate.copy(), (*self._direction * fitness, *features)))
549 if self._predicted_cell(features) is None or not self.container.in_bounds(fitness, self.container.fitness_domain):
550 return set()
551 return {0} if self.container._merge_fronts([individual]) else set()
Select one genuine evaluation with expected joint improvement of elites.
Definition bayesian.py:99
tell(self, individual, fitness=None, features=None, scores=None, elapsed=None, verbose=False, tell_container=True)
Definition bayesian.py:398
_acquisition(self, models, points, thresholds, cutoff)
Definition bayesian.py:303
_commit_generation(self, evaluated)
Definition bayesian.py:422
_descriptors(self, genomes, latents)
Definition bayesian.py:250
_posterior(self, models, points)
Definition bayesian.py:294
_structured_probabilities(self, points, means, deviations)
Definition bayesian.py:256
Combine probability of cell membership with exact two-objective Gaussian EHVI.
Definition bayesian.py:471
predict(self, points)
Evaluate a common kernel and variance solve for all responses.
Definition bayesian.py:75
_check_measurements(self, individual)
Definition modern.py:216
_offer_to_grid(self, individual, cell)
Definition modern.py:228