JuliaGaussianProcesses / KernelFunctions.jl

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

Simplify implementation of `Delta` #378

Closed devmotion closed 3 years ago

devmotion commented 3 years ago

Addresses https://github.com/JuliaGaussianProcesses/KernelFunctions.jl/pull/370#discussion_r723545170 and similar comments in the PR (let's see if it breaks anything and what additional fixes are needed :smile:).

In general, I think we should stop implementing internal, unexported and undocumented functions from Distances if it does not provide any clear performance benefit (e.g. in DotProduct). Nowadays it should be sufficient to just define (::Dist)(x, y) for the desired types of x and y. This could be added to this PR or done separately.

(Edit: At some point, we should probably make the long-proposed move and roll our own binary ops system with a Distances fallback and do not incorrectly declare these operations as metrics)