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

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

Open theogf opened this issue 2 years ago • 5 comments

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

theogf avatar Mar 28 '23 16:03 theogf

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.

devmotion avatar Mar 28 '23 18:03 devmotion

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

theogf avatar Mar 28 '23 20:03 theogf

Has this been fixed?

theo-brown avatar Feb 06 '24 11:02 theo-brown

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

theogf avatar Feb 06 '24 18:02 theogf

Reopening as the KernelProduct still has the issue

theogf avatar Feb 09 '24 08:02 theogf