-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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
endMotivation / 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
endAlternatives 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Backlog