FalkonML / falkon

Large-scale, multi-GPU capable, kernel solver
https://falkonml.github.io/falkon/
MIT License
181 stars 22 forks source link

error when using matrix for the arugument sigma in GaussianKernel #67

Open tinachentc opened 1 year ago

tinachentc commented 1 year ago

Hi,

I'm trying the example of GaussianKernel- mat = torch.randn(3, 3, dtype=torch.float64) sym_mat = mat @ mat.T K = falkon.kernels.GaussianKernel(sigma=sym_mat)

But I got the error- ''.../falkon/kernels/distance_kernel.py", line 33, in validate_sigma raise ValueError("sigma must be a scalar or a vector.") ValueError: sigma must be a scalar or a vector.

Is the current version of falkon accept matrix for the sigma argument? Could you help with this issue? FYI, I'm using falkon 0.8.4 with torch version 1.13.0 and python 3.9. There's no problem when I use a scalar or a vector for the argument sigma.

Could you help with this? Thanks!

Giodiro commented 1 year ago

Hi! Yes, matrix sigma is not supported. Feel free to contribute to this if you wish! The relevant function which needs to add support is here!