b-shields / edbo

Experimental Design via Bayesian Optimization
MIT License
122 stars 41 forks source link

Non stationary kernel #15

Closed shenggong1996 closed 3 years ago

shenggong1996 commented 3 years ago

Does EDBO support non-stationary kernel like linear kernel?

b-shields commented 3 years ago

On a high level, EDBO allows any surrogate model you would like. To support most acquisition functions (except for TS which requires posterior sampling) you need to implement a model class with fit, predict, and variance methods (see https://github.com/b-shields/edbo/blob/master/edbo/models.py as an example). To change the GP kernel to linear you can add a new base model (check https://github.com/b-shields/edbo/blob/master/edbo/base_models.py) that uses GPyTorch's linear kernel (https://docs.gpytorch.ai/en/stable/kernels.html#linearkernel) and swap it into edbo.models.GP_Model.

If you really would just like to try a linear kernel I would suggest checking out the already implemented Bayesian linear model with ARD (https://b-shields.github.io/edbo/models.html#edbo.models.Bayesian_Linear_Model). This is equivalent to a GP + a linear kernel except for the training details.