Metadata-Version: 2.1
Name: laplace-bayesopt
Version: 0.1.4
Summary: Bayesian optimization interface for the laplace-torch library
Author-Email: Agustinus Kristiadi <agustinus@kristia.de>
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Project-URL: Homepage, https://github.com/wiseodd/laplace-bayesopt
Project-URL: Bug tracker, https://github.com/wiseodd/laplace-bayesopt/issues
Requires-Python: >=3.9
Requires-Dist: asdfghjkl
Requires-Dist: backpack-for-pytorch
Requires-Dist: botorch
Requires-Dist: gpytorch
Requires-Dist: opt_einsum
Requires-Dist: torch
Requires-Dist: torchaudio
Requires-Dist: torchvision
Requires-Dist: coveralls; extra == "tests"
Requires-Dist: pytest; extra == "tests"
Requires-Dist: pytest-cov; extra == "tests"
Requires-Dist: scipy; extra == "tests"
Provides-Extra: tests
Description-Content-Type: text/markdown

# Bayesian Optimization Interface for `laplace-torch`

## Installation

Install PyTorch first, then:

```
pip install --upgrade pip wheel packaging
pip install git+https://github.com/aleximmer/laplace.git@0.2
pip install 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 MultiTaskGP model.
```

The full arguments of `LaplaceBoTorch` can be found in the class documentation.

Check out a full BoTorch example in `examples/botorch/experiments.py`.

## Useful References

- General Laplace approximation: <https://arxiv.org/abs/2106.14806>
- Laplace for Bayesian optimization: <https://arxiv.org/abs/2304.08309>
- Benchmark of neural-net-based Bayesian optimizers: <https://arxiv.org/abs/2305.20028>
- The case for neural networks for Bayesian optimization: <https://arxiv.org/abs/2104.11667>

## 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}
}
```
