Open grero opened 1 year ago
Patch coverage has no change and project coverage change: -14.31
:warning:
Comparison is base (
ef6d459
) 94.16% compared to head (6b153d9
) 79.85%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Thanks for opening this PR.
I understand why you've taken this approach, but I don't believe it's the correct approach, as whether or not the input-dimension comparison should be performed is a function of the kernel, not the input type. For example, it (should be) perfectly fine to feed a Vector{Vector{Float64}}
into an SEKernel
, and in that case we would generally like to check that the input dimensions match.
To my mind, a better implementation would be to switch the check on / off depending upon which kernel is employed.
@theogf @devmotion @st-- do any of you have thoughts on this problem? I'm starting to wonder whether having this check is more hassle than it's worth, because the fix looks like it's going to be a bit tricky to implement.
To my mind, a better implementation would be to switch the check on / off depending upon which kernel is employed.
Yes, I agree, that seems to be the best and most general approach. Maybe also dim
is too specific and instead we should add a function such as are_valid_inputs(kernel, x, y)::Bool
as the basis of valid_inputs
?
Summary
This attempts to address #512, which prevents kernels operating on vectors of unequal length from working properly.
Proposed changes
What alternatives have you considered?
The most obvious alternative would be to implement my own type, wrapping AbstractVector{<:AbstractVector{<:Real}}, but since this change would potentially benefit others with similar needs, a fix in KernelFunctions itself seemed more appropriate. Breaking changes
The main change is that inputs checks that are currently failing would pass. This is potentially breaking, as it is possible that downstream code could rely on these checks.