Skip to content

Question on ScaledKernel #468

@simsurace

Description

@simsurace

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions