Skip to content

Commit

Permalink
Initialize without discretizing to save some matrix exponentials
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed May 14, 2023
1 parent a904f54 commit 3556779
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/derivative_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ function calc_H!(H, integ, cache)
if integ.alg isa EK0
calc_H_EK0!(H, integ, cache)
if integ.alg.prior isa IOUP
H .-= cache.prior.rate_parameter * E0
ProbNumDiffEq._matmul!(H, cache.prior.rate_parameter, E0, -1.0, 1.0)
end
elseif integ.alg isa EK1
calc_H_EK0!(H, integ, cache)
# @assert integ.u == @view x_pred.μ[1:(q+1):end]
if integ.f isa SplitFunction
ddu .= integ.f.f1.f
else
Expand Down
4 changes: 3 additions & 1 deletion src/priors/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ See also: [`make_transition_matrices`](@ref).
[1] N. Krämer, P. Hennig: **Stable Implementation of Probabilistic ODE Solvers** (2020)
"""
function initialize_transition_matrices(p::AbstractODEFilterPrior{T}, dt) where {T}
Ah, Qh = discretize(p, dt)
d, q = p.wiener_process_dimension, p.num_derivatives
D = d * (q+1)
Ah, Qh = zeros(T, D, D), PSDMatrix(zeros(T, D, D))
P, PI = initialize_preconditioner(p, dt)
A = P * Ah * PI
Q = X_A_Xt(Qh, P)
Expand Down

0 comments on commit 3556779

Please sign in to comment.