Skip to content

Multi-fidelity surrogate models#721

Open
jpenn2023 wants to merge 49 commits into
dev/mfbofrom
dev-mfbo-main-surrogate-models
Open

Multi-fidelity surrogate models#721
jpenn2023 wants to merge 49 commits into
dev/mfbofrom
dev-mfbo-main-surrogate-models

Conversation

@jpenn2023

Copy link
Copy Markdown
Collaborator

Adding multi-fidelity properties for the SearchSpace class and multi-fidelity Gaussian process classes with the required fidelity kernels.

Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/multi_fidelity.py Outdated
@AdrianSosic AdrianSosic force-pushed the dev-mfbo-main-surrogate-models branch from ccac1f8 to 178772a Compare February 4, 2026 16:58
Comment thread baybe/surrogates/gaussian_process/multi_fidelity.py Outdated

@AVHopp AVHopp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some comments on everything but the multi_fidelity.py file, as I guess that we will discuss this today in a bit more detail.

Comment thread baybe/kernels/basic.py Outdated
Comment thread baybe/searchspace/core.py
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/presets/default.py Outdated
Comment thread baybe/surrogates/gaussian_process/presets/fidelity.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/multi_fidelity.py Outdated
@jpenn2023 jpenn2023 force-pushed the dev-mfbo-main-surrogate-models branch from 2e64082 to 8e8547b Compare February 27, 2026 07:29
@AdrianSosic

Copy link
Copy Markdown
Collaborator

Hey @jpenn2023, I just wanted to have a look at your PR but then noticed that something went wrong with your rebase. I know you asked me about the weird diff shown on Github (and yes, that is generally still a problem), but it turns out that your diff is wrong for a different reason – namely because you somehow rebased your commits together with an entire bunch of other commits 😬 Can you quickly fix it and ping me once ready for review?

@jpenn2023 jpenn2023 force-pushed the dev-mfbo-main-surrogate-models branch from d96cf75 to 2c513b0 Compare March 6, 2026 12:25
@AdrianSosic AdrianSosic force-pushed the dev-mfbo-main-surrogate-models branch from 2c513b0 to 754d5da Compare March 6, 2026 13:48
@AdrianSosic AdrianSosic changed the base branch from dev/mfbo to main March 6, 2026 13:54
@AdrianSosic AdrianSosic changed the base branch from main to dev/mfbo March 6, 2026 13:55
@AdrianSosic AdrianSosic force-pushed the dev-mfbo-main-surrogate-models branch from 754d5da to 563b86a Compare March 6, 2026 17:21
@AdrianSosic AdrianSosic changed the base branch from dev/mfbo to main March 6, 2026 17:22
@AdrianSosic AdrianSosic changed the base branch from main to dev/mfbo March 6, 2026 17:22
@AdrianSosic AdrianSosic force-pushed the dev-mfbo-main-surrogate-models branch from 563b86a to 88db97f Compare March 6, 2026 17:26
@AdrianSosic

Copy link
Copy Markdown
Collaborator

Hey @jpenn2023, have a look, this should now give you a clean picture of your PR content, right?

@jpenn2023

Copy link
Copy Markdown
Collaborator Author

Hey @jpenn2023, have a look, this should now give you a clean picture of your PR content, right?

Hi @AdrianSosic. Yes, this view looks right to me.

@Scienfitz Scienfitz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

my biggest question is why the concepts of TL and MF are now deedply intertwined by using a single searchspace property for combining them isntead of two properties characterizing the searchspaces task / fidelity character

Comment thread baybe/searchspace/core.py
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/surrogates/base.py Outdated
Comment thread baybe/surrogates/gaussian_process/core.py
Comment thread baybe/recommenders/pure/bayesian/base.py Outdated

@AVHopp AVHopp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some more thoughts from my end

Comment thread baybe/searchspace/core.py
Comment thread baybe/searchspace/core.py
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/multi_fidelity.py Outdated
Comment thread baybe/surrogates/gaussian_process/multi_fidelity.py Outdated
Comment thread baybe/surrogates/gaussian_process/multi_fidelity.py Outdated
Comment thread baybe/surrogates/gaussian_process/multi_fidelity.py Outdated
@AVHopp

AVHopp commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

@jpenn2023 it seems like the continuous search space example is currently failing which is why the doc building does not run (just FYI as reading the doc building error logs can be a bit annoying)

@AVHopp AVHopp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've found several comments that were marked as resolved without them actually being addressed. Please ONLY resolve comments when the changes are actually visible and have been pushed. Also, it would be great if you could give context when resolving a comment. For example, I asked an explicit question at one point and the comment was just being resolved without providing an answer and without changing the corresponding code.

EDIT: Whoopsie, this was on me. Ignore :)

Comment thread baybe/surrogates/gaussian_process/core.py Outdated
Comment thread baybe/searchspace/core.py
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/searchspace/core.py Outdated
Comment thread baybe/surrogates/gaussian_process/multi_fidelity.py Outdated
AVHopp added 28 commits June 26, 2026 13:51
Previously, it was able to have a search space with multiple
fidelity/task parameters as well as having both types of
parameters. It was decided not to support this, so validation and
according tests were added.
Note that we cannot use a mean factory here since the
corresponding BoTorch class for the surrogate does not support
handing over a mean_module via `__init__`. The construction of
the kernel is left to BoTorch internally, so there is also no need
for a kernel factory.
Since we hand over to the BoTorch model in the case of
numerical fidelities and to the core GP surrogate in the
case of categorical fidelities, we need to perform the
corresponding validations in the corresponding cases.
The reason for this generalization is that using the discrete
fidelity parameter is intended to trigger the same behavior as the
presence of a task parameter - use an index kernel.
As both transfer learning and multi-fidelity cases are mutually
exclusive, we can unify the logic for both cases in a single method.
…eters

Extends `_BayBETaskKernelFactory` to accept fidelity parameter kinds alongside
task parameters. Also generalizes validators from task-only to any index-type
As the factory now handles both task and categorical fidelity kernels,
the previous name was misleading.
This follows the same pattern as the auto-dispatch of the acquisition function
by changing the field to allow `None`. The correct model is then selected
upon the first call to `get_surrogate` since this is when the search space
is available
This generalizes the previous behavior which only used LOO
for search spaces with a TaskParameter.
Previously, the fit context was only validate within
the surrogates `_fit` method. As this is called only
after caching the surrogate, it was possible to create
broken surrogate caches
This was deleted by accident on a merge.
Previously, the default surrogate model was lazily chosen
during the first use. This causes issues if the same
recommender is used, but a search space requiring a diffferent
surrogate model is used, as the surrogate model was not
re-dispatched. This changes this behavior by memorizing the
which surrogate model was auto-selected previously and only
replace it when a new kind of search space requiring a differend
default surrogate model is used.
Since the ICML kernel factory is only able to handle
categorical fidelities, the check needed to be tightened
Previously, search spaces that only contained task
or fidelity parameters were piped through until they
reached BoTorch normalization. There, they caused an
onimous error about the `indices` list being empty.
This is now checked earlier and returns a more informative
error message.
Variant A of removing the explicit surrogate class
for Multi Fidelity models. This approach now dispatches
to the corresponding surrogate class based from botorch
on the model-class inside the `_fit` method. That is,
we do not recreate the botorch model but simply use it.
@AVHopp AVHopp force-pushed the dev-mfbo-main-surrogate-models branch from 6167b93 to dbe5a3d Compare June 26, 2026 12:52
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