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

test_AD "normal" kernels vs MOKernels

Open st-- opened this issue 3 years ago • 3 comments

https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/pull/263 by @david-vicente introduced separate methods for test_AD for MOKernel - I'm concerned this means that we won't be running the same set of tests for MOKernels.

Maybe that's how it has to be, but then it seems like the type hierarchy isn't quite right - we should obey Liskov substitution principle, right?

This to me seems like a case where overloading the same method isn't really the right thing to do (because it suggests they do the same thing - it's a kernel AD check in either case - but they don't actually seem to check the same things)... now that i've got y'all in a thread, what is your opinion on these ?

Originally posted by @st-- in https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/pull/414#r771854325

st-- avatar Dec 18 '21 19:12 st--

Hmm yeah, I think you're right -- this slipped by us. Presumably we should just be constructing MOKernel-specific inputs (in the default case) and passing these on to the regular testing function or something (i.e. like we do with the interface tests). Is this the kind of thing that you had in mind?

willtebbutt avatar Dec 18 '21 19:12 willtebbutt

Sorry for the trouble. At the time I was having a hard time using the existing methods because I wanted to perform AD tests for a kernel with tuples of Ints and Floats as inputs, and the existing code didn't consider that case.

david-vicente avatar Dec 20 '21 12:12 david-vicente

Ahhh yes, now I remember. The Julia AD testing infrastructure has progressed since we last looked at this, so maybe it's able to handle it now?

willtebbutt avatar Dec 20 '21 12:12 willtebbutt