Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
probml
GitHub Repository: probml/pyprobml
Path: blob/master/notebooks/book2/08/kf_tracking_script.ipynb
1193 views
Kernel: Python 3.9.12 ('venv': venv)

Tracking a 2d point moving in the plane using the Kalman filter

We use the dynamax library.

try: import dynamax except ModuleNotFoundError: print('installing dynamax') %pip install -qq git+https://github.com/probml/dynamax.git import dynamax
# Silence WARNING:root:The use of `check_types` is deprecated and does not have any effect. # https://github.com/tensorflow/probability/issues/1523 import logging logger = logging.getLogger() class CheckTypesFilter(logging.Filter): def filter(self, record): return "check_types" not in record.getMessage() logger.addFilter(CheckTypesFilter())
from dynamax.linear_gaussian_ssm.demos.kf_tracking import kf_tracking, plot_kf_tracking x, y, lgssm_posterior = kf_tracking() dict_figures = plot_kf_tracking(x, y, lgssm_posterior) for k, v in dict_figures.items(): fname = k + ".pdf" print("saving ", fname) fig = v fig.savefig(fname)
WARNING:absl:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)
saving kalman_tracking_truth.pdf saving kalman_tracking_filtered.pdf saving kalman_tracking_smoothed.pdf
Image in a Jupyter notebookImage in a Jupyter notebookImage in a Jupyter notebook