Skip to content
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

Question on ScaledKernel #468

Open
simsurace opened this issue Aug 24, 2022 · 0 comments
Open

Question on ScaledKernel #468

simsurace opened this issue Aug 24, 2022 · 0 comments

Comments

@simsurace
Copy link
Member

What is the advantage/use case of using a vector for the variance here?

struct ScaledKernel{Tk<:Kernel,Tσ²<:Real} <: Kernel
kernel::Tk
σ²::Vector{Tσ²}
end
function ScaledKernel(kernel::Tk, σ²::Tσ²=1.0) where {Tk<:Kernel,Tσ²<:Real}
@check_args(ScaledKernel, σ², σ² > zero(Tσ²), "σ² > 0")
return ScaledKernel{Tk,Tσ²}(kernel, [σ²])
end

It seems to me that the allocations just hurt performance without any benefit.
Shall we get rid of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant