Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Multi Information Source Augmented GP #2152

Closed
wants to merge 21 commits into from
Closed

Add Multi Information Source Augmented GP #2152

wants to merge 21 commits into from

Conversation

andreaponti5
Copy link
Contributor

Motivation

This pull request introduces the implementation of the Augmented Gaussian Process (AGP) and a related acquisition function based on UCB, namely Augmented UCB (AUCB), for multi information source problems.

Candelieri, A., Archetti, F. Sparsifying to optimize over multiple information sources: an augmented Gaussian process based algorithm. Struct Multidisc Optim 64, 239–255 (2021). https://doi.org/10.1007/s00158-021-02882-7

AGP and AUCB in a nutshell

The key idea of the AGP is to fit a GP model for each information source and augment the observations on the high fidelity source with those from cheaper sources which can be considered as reliable. The GP model fitted on this augmented set of observations is the AGP.

The AUCB is a modification of the standard UCB - computed on the AGP - suitably proposed to also deal with the source-specific query cost.

Example

This is what the AGP and AUCB look like on the Forrester problem considering 2 sources.

Some implementation details

The Augmented GP implementation is based on the SingleTaskGP.
Each source is implemented as an independent SingleTaskGP and all the reliable observations are used to fit the SingleTaskGP representing the AGP, namely SingleTaskAugmentedGP. A key difference with the Multi-Fidelity approaches in BoTorch, is that the dimension representing the source is not directly modelled by the AGP.
In addition, a Fixed-Noise version of the AGP has been implemented based on the FixedNoiseGP.

The Augmented UCB implementation is based on the UpperConfidenceBound, but it is penalized by the cost of the source and the discrepancy from the AGP.

Have you read the Contributing Guidelines on pull requests?

Yes, I have read the Contributing Guidelines on pull requests.

Test Plan

A bunch of unit tests for both, the AGP and AUCB, has been implemented. Those are inspired by the SingleTaskGP and UpperConfidenceBound tests, respectively.

In addition, a notebook tutorial shows how to use the AGP model along with the AUCB acquisition function and a comparison with the Multi-Fidelity MES on the Augmented Branin test function.

Finally, we plan to release an arXiv soon, with an extensive comparison of Multi-Fidelity and Multi Information Source approaches in BoTorch. Here are some preliminary results on the Augmented Hartmann test function, considering three sources (with fidelities $[0.50, 0.75, 1.00]$). The AGP has been compared with the discrete Multi-Fidelity version of the Knowled Gradient (KG), Max-value Entropy Search (MES) and GIBBON. The figure on the left shows the best seen with respect to the query cost, while the figure on the right shows the best seen with respect to the wall-clock time.

Related PRs

The docs has been updated in this PR.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Dec 18, 2023
@sdaulton
Copy link
Contributor

Thanks for putting up the PR! This works looks quite interesting!

@facebook-github-bot
Copy link
Contributor

@sdaulton has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@saitcakmak
Copy link
Contributor

saitcakmak commented Jan 22, 2024

Hi @andreaponti5. Thanks for the PR! We're trying out a new support model for community contributions: https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md#community-contributions-beta. Can you move the new additions to the botorch_community, notebooks_community & test_community directories and add the contributor info and other metadata to the files as outlined in the readme files? Thanks!

Copy link
Contributor

@Balandat Balandat left a comment

Choose a reason for hiding this comment

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

Thanks - looks like there are some minor lint and auto-sort code formatting issues. I also left a couple of inline comments that would be great to address (though potentially ok to do this in a follow-up PR).

@@ -182,4 +182,4 @@ Inducing Point Allocators
Other Utilties
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: botorch.models.utils.assorted
:members:
:members:
Copy link
Contributor

Choose a reason for hiding this comment

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

what happened here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what happened. I removed SingleTaskAugmentedGP from the doc. Community contributions shouldn't go in the documentation, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

@saitcakmak what are your thoughts re community contribs? Would be nice if we generated docs as part of the community modules (maybe not part of the core modules) given that people are putting effort into their docstrings (thanks!).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think it'd be good to have generated docs for community modules on the website. We can build it when building the community tutorials for the website.

@facebook-github-bot
Copy link
Contributor

@sdaulton has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@sdaulton merged this pull request in defe657.

@Balandat
Copy link
Contributor

Merged! Thanks again @andreaponti5 for your contribution.

@andreaponti5 andreaponti5 deleted the add-multisource-agp branch February 21, 2024 08:04
stefanpricopie pushed a commit to stefanpricopie/botorch that referenced this pull request Feb 27, 2024
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to make BoTorch better.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to BoTorch here: https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md
-->

## Motivation

This pull request introduces the implementation of the **Augmented Gaussian Process** (AGP) and a related acquisition function based on UCB, namely **Augmented UCB** (AUCB), for multi information source problems.

> Candelieri, A., Archetti, F. Sparsifying to optimize over multiple information sources: an augmented Gaussian process based algorithm. Struct Multidisc Optim 64, 239–255 (2021). [https://doi.org/10.1007/s00158-021-02882-7](https://doi.org/10.1007/s00158-021-02882-7)

### AGP and AUCB in a nutshell
The key idea of the AGP is to fit a GP model for each information source and *augment* the observations on the high fidelity source with those from *cheaper* sources which can be considered as *reliable*. The GP model fitted on this *augmented* set of observations is the AGP.

The AUCB is a modification of the standard UCB - computed on the AGP - suitably proposed to also deal with the source-specific query cost.

### Example
This is what the AGP and AUCB look like on the Forrester problem considering 2 sources.
<p align="center">
<img src="https://github.com/pytorch/botorch/assets/59694427/72c43b56-e08b-4b47-aea9-00925345890c" height="500">
</p>

### Some implementation details
The Augmented GP implementation is based on the `SingleTaskGP`.
Each source is implemented as an independent `SingleTaskGP` and all the _reliable_ observations are used to fit the SingleTaskGP representing the AGP, namely `SingleTaskAugmentedGP`. A key difference with the Multi-Fidelity approaches in BoTorch, is that the dimension representing the source is not directly modelled by the AGP.
In addition, a Fixed-Noise version of the AGP has been implemented based on the `FixedNoiseGP`.

The Augmented UCB implementation is based on the `UpperConfidenceBound`, but it is penalized by the cost of the source and the discrepancy from the AGP.

### Have you read the [Contributing Guidelines on pull requests](https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md#pull-requests)?

Yes, I have read the Contributing Guidelines on pull requests.

Pull Request resolved: pytorch#2152

Test Plan:
A bunch of unit tests for both, the AGP and AUCB, has been implemented. Those are inspired by the `SingleTaskGP` and `UpperConfidenceBound` tests, respectively.

In addition, a notebook tutorial shows how to use the AGP model along with the AUCB acquisition function and a comparison with the Multi-Fidelity MES on the Augmented Branin test function.

Finally, we plan to release an arXiv soon, with an extensive comparison of Multi-Fidelity and Multi Information Source approaches in BoTorch. Here are some preliminary results on the Augmented Hartmann test function, considering three sources (with fidelities $[0.50, 0.75, 1.00]$). The AGP has been compared with the discrete Multi-Fidelity version of the Knowled Gradient (KG), Max-value Entropy Search (MES) and GIBBON. The figure on the left shows the best seen with respect to the query cost, while the figure on the right shows the best seen with respect to the wall-clock time.
<p align="center">
<img src="https://github.com/pytorch/botorch/assets/59694427/77cfcebc-8123-4802-8045-5d9b359775ec" height="300">
</p>

## Related PRs
The docs has been updated in this PR.

Reviewed By: Balandat

Differential Revision: D52256404

Pulled By: sdaulton

fbshipit-source-id: 863437b488dcee6b37306dcd6c1ee6b63ca9c55f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants