Skip to content

GP Criterion#789

Merged
AdrianSosic merged 13 commits into
dev/gpfrom
feature/gp_criterion
May 12, 2026
Merged

GP Criterion#789
AdrianSosic merged 13 commits into
dev/gpfrom
feature/gp_criterion

Conversation

@AdrianSosic
Copy link
Copy Markdown
Collaborator

@AdrianSosic AdrianSosic commented May 6, 2026

DevPR, parent is #745

Makes the optimization criterion of the GaussianProcessSurrogate model configurable, in the form of a new FitCriterion enum. 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.

@AdrianSosic AdrianSosic self-assigned this May 6, 2026
@AdrianSosic AdrianSosic added new feature New functionality dev labels May 6, 2026
@AdrianSosic AdrianSosic changed the base branch from main to dev/gp May 6, 2026 09:10
@AdrianSosic AdrianSosic changed the title Feature/gp criterion GP criterion May 6, 2026
@AdrianSosic AdrianSosic changed the title GP criterion GP Criterion May 6, 2026
@AdrianSosic AdrianSosic marked this pull request as ready for review May 6, 2026 09:12
@AdrianSosic AdrianSosic requested a review from Scienfitz as a code owner May 6, 2026 09:12
Copilot AI review requested due to automatic review settings May 6, 2026 09:12
@AdrianSosic AdrianSosic requested a review from AVHopp as a code owner May 6, 2026 09:12
@AdrianSosic AdrianSosic marked this pull request as draft May 6, 2026 09:12
@AdrianSosic AdrianSosic changed the base branch from dev/gp to main May 6, 2026 09:13
@AdrianSosic AdrianSosic changed the base branch from main to dev/gp May 6, 2026 09:13
@AdrianSosic AdrianSosic force-pushed the feature/gp_criterion branch from 8f62cdb to cd7ce36 Compare May 6, 2026 09:18
@AdrianSosic AdrianSosic marked this pull request as ready for review May 6, 2026 09:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Criterion enum (+ factory protocol/Plain factory) with a to_gpytorch(...) adapter to create the appropriate GPyTorch MLL.
  • Extend GaussianProcessSurrogate to accept criterion_or_factory and use it during _fit when calling fit_gpytorch_mll.
  • Update GP presets to expose a default criterion choice and export Criterion via 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

  • PresetCriterionFactory is set to the BayBECriterionFactory class rather than an instance. Given from_preset currently does not instantiate PresetCriterionFactory, this will pass a class through and later fail when invoked with (searchspace, train_x, train_y). Set PresetCriterionFactory = BayBECriterionFactory() (or adjust from_preset to 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.

Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/presets/baybe.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py
Comment thread baybe/surrogates/gaussian_process/presets/baybe.py Outdated
@AdrianSosic AdrianSosic marked this pull request as draft May 6, 2026 09:21
@AdrianSosic AdrianSosic force-pushed the feature/gp_criterion branch from cd7ce36 to 920dd88 Compare May 6, 2026 09:35
@AdrianSosic AdrianSosic marked this pull request as ready for review May 6, 2026 09:49
Comment thread baybe/surrogates/gaussian_process/components/criterion.py Outdated
@AdrianSosic AdrianSosic mentioned this pull request May 6, 2026
Copy link
Copy Markdown
Collaborator

@AVHopp AVHopp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please verify and fix the missing ()

Comment thread baybe/surrogates/gaussian_process/presets/baybe.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Copy link
Copy Markdown
Collaborator

@Scienfitz Scienfitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly questions of naming

Comment thread baybe/surrogates/gaussian_process/components/generic.py
Comment thread baybe/surrogates/gaussian_process/components/generic.py Outdated
Comment thread baybe/surrogates/gaussian_process/components/fit_criterion.py
Copy link
Copy Markdown
Collaborator

@AVHopp AVHopp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If all open issues are resolved, then this is good to merge

@AdrianSosic AdrianSosic force-pushed the feature/gp_criterion branch from 9be4dd0 to 7ff993d Compare May 6, 2026 17:41
@AdrianSosic AdrianSosic force-pushed the feature/gp_criterion branch from 7ff993d to 2f847b6 Compare May 6, 2026 17:41
@AdrianSosic AdrianSosic force-pushed the feature/gp_criterion branch from c4f12a8 to d55fd74 Compare May 11, 2026 15:49
@AdrianSosic AdrianSosic force-pushed the feature/gp_criterion branch from d55fd74 to f11e111 Compare May 11, 2026 19:28
@AdrianSosic AdrianSosic merged commit 5258a8f into dev/gp May 12, 2026
12 of 13 checks passed
@AdrianSosic AdrianSosic deleted the feature/gp_criterion branch May 12, 2026 11:16
@AdrianSosic AdrianSosic mentioned this pull request May 12, 2026
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev new feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants