Feature/Enhancement Description
Considering the current implementation (below), we note that gbar is assumed to be square of dims equal to distribution, but this is not always the case.
function approximate_kernel_expectation(method::AbstractApproximationMethod, g::Function, m::AbstractVector{T}, P::AbstractMatrix{T}) where {T <: Real}
ndims = length(m)
weights = getweights(method, m, P)
points = getpoints(method, m, P)
gbar = zeros(ndims, ndims)
foreach(zip(weights, points)) do (weight, point)
axpy!(weight, g(point), gbar) # gbar = gbar + weight * g(point)
end
return gbar
end
Motivation / Use Case
RxGP.jl forms kernel function expectations that are non-square.
Proposed Solution
Per @HoangMHNguyen's work, the below seems to work well.
function approximate_kernel_expectation(method::AbstractApproximationMethod, g::Function, m::AbstractVector{T}, P::AbstractMatrix{T}) where {T <: Real}
weights = getweights(method, m, P)
points = getpoints(method, m, P)
gbar = g(m) .* 0.0
foreach(zip(weights, points)) do (weight, point)
axpy!(weight, g(point), gbar) # gbar = gbar + weight * g(point)
end
return gbar
end
Alternatives Considered
No response
Example Use Cases
No response
Priority (from your perspective)
Critical for my use case
Related Issues / Discussions
No response
Additional Context
No response
Feature/Enhancement Description
Considering the current implementation (below), we note that
gbaris assumed to be square of dims equal to distribution, but this is not always the case.Motivation / Use Case
RxGP.jl forms kernel function expectations that are non-square.
Proposed Solution
Per @HoangMHNguyen's work, the below seems to work well.
Alternatives Considered
No response
Example Use Cases
No response
Priority (from your perspective)
Critical for my use case
Related Issues / Discussions
No response
Additional Context
No response