rmcantin / bayesopt

BayesOpt: A toolbox for bayesian optimization, experimental design and stochastic bandits.
GNU Affero General Public License v3.0
400 stars 92 forks source link

Access to the surrogate model through C API? #23

Open jbrea opened 6 years ago

jbrea commented 6 years ago

Hi

I like your package and wrote a little julia wrapper.

One thing I couldn't easily figure out was how to access the surrogate model after fitting (my C++ is a bit limited). Is there an easy way (ideally through functions similar to the ones in the current C API) to access the surrogate model (e.g. inspect kernel parameters, sampling from the model or evaluating mean and sigma for some inputs)?

rmcantin commented 5 years ago

Thanks for the wrapper! If you want to integrate it in the library, please send me an email rmcantin@unizar.es and I'll help you with that.

Right now the C API is only a wrapper of the full optimization call. You can't even perform step by step optimization. I have been wanting to refactor the C API and make it more general for a while, but it would require a whole redesign of the API for all languages.

If you want to see how to access the surrogate model from C++, you can see how it is displayed in the examples, using this helper class https://github.com/rmcantin/bayesopt/blob/master/utils/displaygp.cpp

jbrea commented 5 years ago

Thanks for your response.

I think there is no need to integrate the wrapper here. Julia packages are usually in their separate github repository anyway. But feel free to advertise it here :smile:.

On an unrelated note, do I understand correctly that the implementation of Thompson sampling simply samples a value from the GP for every input given by the optimizer in the acquisition function? If yes, does this really lead to samples from the maximum distribution in the case of continuous input spaces? Do you think there would be some benefit in using methods like the one proposed in https://arxiv.org/abs/1604.00169?