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

Add tests for unequal-length inputs #553

Closed simsurace closed 6 months ago

simsurace commented 6 months ago

To test whether kernelmatrix_diag gives the same output as diag ∘ kernelmatrix for two inputs of different lengths, c.f. question in #552.

If tests pass, we could in principle decide to remove the comment in the docstring and make that part of the public API.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c97a246) 90.88% compared to head (a2902be) 42.19%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #553 +/- ## =========================================== - Coverage 90.88% 42.19% -48.69% =========================================== Files 52 52 Lines 1459 1448 -11 =========================================== - Hits 1326 611 -715 - Misses 133 837 +704 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

willtebbutt commented 6 months ago

I'm not hugely opposed to this, but I would like to know if you can think of a good use-case for getting an off-diagonal of the kernel matrix. If there's not a good reason to include it in the interface, I'd rather not start having to support it.

simsurace commented 6 months ago

Well, it actually does not seem to work for many kernels and mainly because of the calls to Distances.jl. I don't have a specific use case but simply noted the discrepancy with LinearAlgebra.diag and that it tends to work for the scalar inputs.

willtebbutt commented 6 months ago

Okay. Shall we just leave this then?

simsurace commented 6 months ago

Yeah, let's close this for now.