From 3556779775f4ae13c4c37f03a9a2058e7b51b766 Mon Sep 17 00:00:00 2001 From: Nathanael Bosch Date: Sun, 14 May 2023 12:00:33 +0200 Subject: [PATCH] Initialize without discretizing to save some matrix exponentials --- src/derivative_utils.jl | 3 +-- src/priors/common.jl | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/derivative_utils.jl b/src/derivative_utils.jl index 621c8dc66..764baf7a2 100644 --- a/src/derivative_utils.jl +++ b/src/derivative_utils.jl @@ -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 diff --git a/src/priors/common.jl b/src/priors/common.jl index fab7b0ab8..67a31de57 100644 --- a/src/priors/common.jl +++ b/src/priors/common.jl @@ -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)