GP Criterion#789
Conversation
8f62cdb to
cd7ce36
Compare
There was a problem hiding this comment.
Pull request overview
This PR makes the hyperparameter optimization criterion used by GaussianProcessSurrogate configurable by introducing a new Criterion enum and wiring it into model fitting. It extends the existing “component factory” pattern so presets and user code can select which GPyTorch MLL object is used during training.
Changes:
- Add
Criterionenum (+ factory protocol/Plain factory) with ato_gpytorch(...)adapter to create the appropriate GPyTorch MLL. - Extend
GaussianProcessSurrogateto acceptcriterion_or_factoryand use it during_fitwhen callingfit_gpytorch_mll. - Update GP presets to expose a default criterion choice and export
Criterionvia preset/component__init__.py.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| CHANGELOG.md | Documents the new configurable GP optimization criterion feature. |
| baybe/surrogates/gaussian_process/components/criterion.py | Introduces Criterion and helpers to create the corresponding GPyTorch MLL. |
| baybe/surrogates/gaussian_process/components/generic.py | Extends component typing/validation to allow Criterion as a supported GP component. |
| baybe/surrogates/gaussian_process/components/init.py | Re-exports criterion-related types/factories. |
| baybe/surrogates/gaussian_process/core.py | Adds criterion_factory, plumbs it into _fit, and extends from_preset signature. |
| baybe/surrogates/gaussian_process/presets/baybe.py | Adds BayBE default criterion factory (task-aware selection). |
| baybe/surrogates/gaussian_process/presets/chen.py | Adds a preset criterion factory for CHEN. |
| baybe/surrogates/gaussian_process/presets/edbo.py | Adds a preset criterion factory for EDBO. |
| baybe/surrogates/gaussian_process/presets/edbo_smoothed.py | Adds a preset criterion factory for smoothed EDBO. |
| baybe/surrogates/gaussian_process/presets/init.py | Exports Criterion and the preset criterion factories. |
Comments suppressed due to low confidence (1)
baybe/surrogates/gaussian_process/presets/baybe.py:112
PresetCriterionFactoryis set to theBayBECriterionFactoryclass rather than an instance. Givenfrom_presetcurrently does not instantiatePresetCriterionFactory, this will pass a class through and later fail when invoked with(searchspace, train_x, train_y). SetPresetCriterionFactory = BayBECriterionFactory()(or adjustfrom_presetto instantiate).
# Aliases for generic preset imports
PresetKernelFactory = BayBEKernelFactory
PresetMeanFactory = BayBEMeanFactory
PresetLikelihoodFactory = BayBELikelihoodFactory
PresetCriterionFactory = BayBECriterionFactory
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cd7ce36 to
920dd88
Compare
AVHopp
left a comment
There was a problem hiding this comment.
Please verify and fix the missing ()
Scienfitz
left a comment
There was a problem hiding this comment.
mostly questions of naming
AVHopp
left a comment
There was a problem hiding this comment.
If all open issues are resolved, then this is good to merge
Criterion is a BayBEGPComponent (check is already included)
9be4dd0 to
7ff993d
Compare
7ff993d to
2f847b6
Compare
c4f12a8 to
d55fd74
Compare
d55fd74 to
f11e111
Compare
DevPR, parent is #745
Makes the optimization criterion of the
GaussianProcessSurrogatemodel configurable, in the form of a newFitCriterionenum. Potentially, this might be generalized to a class-based approach in the future if more configuration options are required, but for now the simpler solution serves all existing use cases.