-
Notifications
You must be signed in to change notification settings - Fork 562
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
Arc Kernel for Conditional Spaces #1023
Comments
Sure - this seems like it could be useful to have! We're definitely open to a PR :) |
@BCJuan If you put up a pull request, my recommendation for the implementation as you've written it would be to have def forward(self, x1, x2, diag=False, **params):
x1_, x2_ = self.embedding(x1), self.embedding(x2)
return self.base_kernel(x1_, x2_) See for example how base_kernel = MaternKernel(nu=2.5)
base_kernel.raw_lengthscale.requires_grad_(False) # Don't learn base lengthscale since ArcKernel has one
covar_module = ArcKernel(base_kernel, num_parameters) |
Thank you. I am writing it properly and testing it so the PR makes sense: adding setters and possibilities of priors, etc I will post asa I have the kernel decent for commit and it has passed some tests. I welcome greatly any other recommendation. |
This is great, @BCJuan. Please let us know over at botorch if you need any help with hooking this up with the acquisition functions. |
Hi, I have finally cleaned my implementation. Now I am able to make the PR. I have reproduced the example of (Exact GPs)[https://gpytorch.readthedocs.io/en/latest/examples/01_Exact_GPs/Simple_GP_Regression.html] with the kernel and seems to work fine. I can upload the notebooks, or something similar; as you wish. I do only worry about the kernel size definition. Now is simply a vector of the number of dimensions, but maybe would have to be something like
@Balandat Thank you. Indeed, I have tried to implement it in the tutorial Botorch with Ax but there are numerical problems. The following error appears:
And finally the error:
Also, the
|
Happy to help w/ debugging one the botorch end. Once your PR here is up, can you share the full code so I can reproduce? |
Of course @Balandat. I have change the course of development a little though. I will make the tests for the kernel in gpytorch first and once it is clear that it works properly I will pass to Botorch. Maybe it was bold to go directly to botorch without checking first in Gpytorch. Nevertheless, it would be great to test it in Botorch and see the difference in conditional spaces with respect, for example, Matern kernel. If there is anything I can do, please do not doubt to ask. Thank you! |
🚀 Feature Request
Introduction
I am working on Bayesian optimization with gaussian processes for hyperparameter tuning of ML models. I am indirect user of your library (through Ax and Botorch. Many ML models have conditional configuration spaces. I understand that gaussian processes do not support directly conditional spaces. However, this article Raiders of the Lost Architecture:Kernels for Bayesian Optimization in Conditional Parameter Spaces defines a kernel which would be useful in such spaces.
Motivation
Would be useful to implement this kernel for use in upper libraries. The usage would allow the optimization of conditional configuration spaces by simply implementing this kernel (if I have understood correctly the article).
In the case where conditionality is related to hierarchy, this would solve issues such as this one. Also would be a nice try for a flaw consistently assigned to GPs.
Pitch
In a rough and simplistic way, the kernel consists in a cylindrical embedding in a standard RBF kernel. And then a product of the kernels for each dimension to build the final kernel. I leave the images of the descriptions found in the Github of the project.
I have made myself an implementation:
And for calling it, it would be a composition of
StructuredProductKernel
,ScaleKernel
,RBFKernel
and the newly buildArcKernel
.I can make my self a pull request if the request is accepted. Also, I have not the enough knowledge to ensure that this kernel should work exactly as the explained in the paper. I have made my implementation but have not tested it in any experiment. if desired, I could do also the test bu would need orientation.
Thank you very much in advance.
P.S: you can find info summarized in the repository of the original authors, under the folder latex. I do attach also images from that source.
The text was updated successfully, but these errors were encountered: