https://github.com/wiseodd/laplace-bayesopt
Laplace approximated BNN surrogate for BoTorch
https://github.com/wiseodd/laplace-bayesopt
Last synced: 8 months ago
JSON representation
Laplace approximated BNN surrogate for BoTorch
- Host: GitHub
- URL: https://github.com/wiseodd/laplace-bayesopt
- Owner: wiseodd
- Created: 2023-04-21T14:30:19.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-08T22:20:24.000Z (over 1 year ago)
- Last Synced: 2025-07-02T06:06:31.997Z (9 months ago)
- Language: Python
- Homepage:
- Size: 127 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bayesian Optimization Interface for `laplace-torch`
## Installation
Install PyTorch first, then:
```
pip install --upgrade laplace-bayesopt
```
## Usage
Basic usage
```python
from laplace_bayesopt.botorch import LaplaceBoTorch
def get_net():
# Return a *freshly-initialized* PyTorch model
return torch.nn.Sequential(
...
)
# Initial X, Y pairs, e.g. obtained via random search
train_X, train_Y = ..., ...
model = LaplaceBoTorch(get_net, train_X, train_Y)
# Use this model in your existing BoTorch loop, e.g. to replace BoTorch's SingleTaskGP model.
```
The full arguments of `LaplaceBoTorch` can be found in the class documentation.
Check out examples in `examples/`.
## Useful References
- General Laplace approximation:
- Laplace for Bayesian optimization:
- Benchmark of neural-net-based Bayesian optimizers:
- The case for neural networks for Bayesian optimization:
## Citation
```
@inproceedings{kristiadi2023promises,
title={Promises and Pitfalls of the Linearized {L}aplace in {B}ayesian Optimization},
author={Kristiadi, Agustinus and Immer, Alexander and Eschenhagen, Runa and Fortuin, Vincent},
booktitle={AABI},
year={2023}
}
```