JuliaGaussianProcesses / KernelFunctions.jl

Julia package for kernel functions for machine learning
https://juliagaussianprocesses.github.io/KernelFunctions.jl/stable/
MIT License
267 stars 32 forks source link

`KernelSum` and `KernelProduct` with `Vector` of `Kernel` fails #497

Open theogf opened 1 year ago

theogf commented 1 year ago

Right now these composites will not work if the container is not a Tuple. See

k = SqExponentialKernel()
kk = KernelSum([k, k])
kk(2, 3) # Errors
devmotion commented 1 year ago

From looking at the code, it seems we just forgot to add a fallback for _sum? https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/blob/401d556df996558c417d9f4d5c715ab079cc4e14/src/kernels/kernelsum.jl#L46 We explicitly supports constructors and summation for KernelSum with AbstractVector, so it should work. I'm surprised there's no test for it.

theogf commented 1 year ago

Yes sorry I started with the title, found that the code was almost right and forgot to update.

I will edit the issue name now

theo-brown commented 7 months ago

Has this been fixed?

theogf commented 7 months ago

No the issue still seems to be there. The MWE is wrong, I will adjust it.

theogf commented 7 months ago

Reopening as the KernelProduct still has the issue