-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does 3-arg kernelmatrix_diag
require same length?
#552
Comments
Hmm this definitely isn't an intended feature. Do you know what it computes when they're not the same length? |
Yes the same as what |
Basically, julia> x = rand(5); y = rand(4);
julia> kernelmatrix(SEKernel(), x, y)
5×4 Matrix{Float64}:
0.913674 0.981759 0.925923 0.984204
0.99906 0.848392 0.999942 0.979586
0.998322 0.796401 0.995909 0.954717
0.996092 0.869745 0.998438 0.987599
0.997917 0.85858 0.999488 0.983593
julia> kernelmatrix_diag(SEKernel(), x, y)
4-element Vector{Float64}:
0.9136737830751345
0.8483918154068688
0.9959090633450111
0.9875987951145452
julia> kernelmatrix(SEKernel(), x, y) |> diag
4-element Vector{Float64}:
0.9136737830751345
0.8483918154068689
0.9959090633450111
0.9875987951145452 |
#553 showed that the unequal-length case errors for many kernel and input type combinations. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The docs state that
KernelFunctions.jl/src/matrix/kernelmatrix.jl
Lines 80 to 83 in c97a246
However, testing this function for different-length output works for many kernels (did not try all though).
So is the docstring wrong or is this an accidental feature? (incidentally,
diag
on a non-square matrix works, so the feature could in principle be useful)The text was updated successfully, but these errors were encountered: