Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor UKF Components to use linearize() #635

Merged
merged 24 commits into from
Feb 15, 2022

Conversation

pnkraemer
Copy link
Collaborator

In a Nutshell

With this PR, forward and backward propagation in UKFComponents is handled via explicit linearisation.

Detailed Description

Instead of implementing forward* and backward*, the UKF now only uses a linearise() method, which handles the forward and backward propagation.
This makes a bunch of code obsolete, and simplifies further refactoring steps mentioned in #627.

@pnkraemer pnkraemer changed the title Refactor UKF Components to use linearise() Refactor UKF Components to use linearize() Feb 11, 2022
Comment on lines +32 to +44
compute_jacobian_at = (
_linearise_at
if _linearise_at is not None
else randvars.Constant(realization)
)
linearized_model = self.linearize(t=t, at_this_rv=compute_jacobian_at)
return linearized_model.forward_realization(
realization=realization,
t=t,
dt=dt,
compute_gain=compute_gain,
_diffusion=_diffusion,
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very soon, this whole class can go, and the linearization is done from the outside in, e.g., an ExtendedKalman() object.

@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #635 (b1ba2e1) into main (81b3c37) will increase coverage by 0.00%.
The diff coverage is 98.95%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #635   +/-   ##
=======================================
  Coverage   89.83%   89.84%           
=======================================
  Files         186      186           
  Lines        7063     7020   -43     
  Branches     1109     1104    -5     
=======================================
- Hits         6345     6307   -38     
+ Misses        472      468    -4     
+ Partials      246      245    -1     
Impacted Files Coverage Δ
...rc/probnum/filtsmooth/gaussian/_kalmanposterior.py 84.80% <ø> (ø)
...num/filtsmooth/gaussian/approx/_unscentedkalman.py 98.43% <98.36%> (+6.60%) ⬆️
src/probnum/diffeq/odefilter/_odefilter.py 97.67% <100.00%> (+0.02%) ⬆️
src/probnum/filtsmooth/gaussian/approx/__init__.py 100.00% <100.00%> (ø)
...bnum/filtsmooth/gaussian/approx/_extendedkalman.py 100.00% <100.00%> (ø)
...c/probnum/filtsmooth/gaussian/approx/_interface.py 100.00% <100.00%> (ø)
...m/filtsmooth/particle/_importance_distributions.py 92.15% <100.00%> (ø)

@@ -1,264 +0,0 @@
"""Unscented Transform."""
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the unscented transform can finally go

@pnkraemer pnkraemer marked this pull request as ready for review February 15, 2022 07:41
Copy link
Collaborator

@schmidtjonathan schmidtjonathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, but can be merged from my side.
Thanks for the fine-granular PR ✨

@pnkraemer pnkraemer merged commit 4fe7612 into probabilistic-numerics:main Feb 15, 2022
@pnkraemer pnkraemer deleted the ukf-via-linearisation branch February 15, 2022 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants