KernelFunctions.jl icon indicating copy to clipboard operation
KernelFunctions.jl copied to clipboard

Fix Gabor the bad boy

Open theogf opened this issue 3 years ago • 3 comments

The Gabor kernel constantly but randomly fails the CI tests. We should investigate if we can make a more stable implementation or something similar.

theogf avatar May 05 '21 15:05 theogf

I might be wrong is the implementation compleletely wrong? Or at least inconsistent with the math definition? The math definition we have is : image

But we implement it as a product of a CosineKernel and a SqExponentialKernel : https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/blob/70e3593aa47ce6004f6be0e8bc1b4768f91e6fc5/src/basekernels/gabor.jl#L21

From the definition in https://arxiv.org/abs/1302.4245 it looks like the math definition is wrong and it is essentially a special case of the spectral mixture kernel. I think it would make sense to get rid of it since the spectral mixture implementation would probably not be that much slower than Gabor.

theogf avatar May 06 '21 11:05 theogf

I noticed this a while ago: https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/pull/240

devmotion avatar May 06 '21 11:05 devmotion

In the latest release, https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/issues/284#issuecomment-833445916 is addressed (formula is correct and GaborKernel is deprecated in favour of gaborkernel). It is unclear though if these fixes all test issues. At least so far all AD tests pass for gaborkernel (for GaborKernel only Zygote is enabled).

devmotion avatar May 07 '21 15:05 devmotion