Skip to main content

KalmanFormer - using transformer to model the Kalman Gain in Kalman Filters

Project description

KalmanFormer

Implementation of KalmanFormer.

The paper proposes learning the Kalman Gain directly from data using Transformers, bypassing the limitations of traditional Kalman Filters on non-linear systems.

Install

$ pip install kalmanformer

Usage

import torch
from kalmanformer import KalmanFormer

# kalmanformer

kalmanformer = KalmanFormer(
    state_dim = 3,
    obs_dim = 3,
    dim = 64,
    depth = 2,
    heads = 2,
    dim_head = 32,
    mlp_dim = 64
)

# mock observations

observations = torch.randn(2, 10, 3)

# state transition matrix f and observation matrix h

F = torch.randn(3, 3)
H = torch.randn(3, 3)

# initial state

x_0 = torch.zeros(2, 3)

# tracking over sequence

post_states = kalmanformer(
    observations,
    F,
    H,
    x_0 = x_0
)

assert post_states.shape == (2, 10, 3)

Citations

@article{Shen2025KalmanFormer,
    title   = {KalmanFormer: using transformer to model the Kalman Gain in Kalman Filters},
    author  = {Siyuan Shen and Jichen Chen and Guanfeng Yu and Zhengjun Zhai and Pujie Han},
    journal = {Frontiers in Neurorobotics},
    year    = {2025},
    volume  = {18},
    doi     = {10.3389/fnbot.2024.1460255}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kalmanformer-0.0.10.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kalmanformer-0.0.10-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file kalmanformer-0.0.10.tar.gz.

File metadata

  • Download URL: kalmanformer-0.0.10.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for kalmanformer-0.0.10.tar.gz
Algorithm Hash digest
SHA256 a8db1c3be767718d63d8bacd6e2bfbb9098d589aa857be49d0daae0b529cb82f
MD5 01504be2b8b7b682ac3c10a68a18ffc9
BLAKE2b-256 e12fb26fe12cb384054aebaec792704c4f6c6c0bef8487a4705f7d47a6e0d9d2

See more details on using hashes here.

File details

Details for the file kalmanformer-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for kalmanformer-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 cfeb3f74ceab0283bb389ce95e2fe756f69616c72d9f6842340cf820ba46c66f
MD5 d6657ba2ef6942c1bb332de8fdf8b8b3
BLAKE2b-256 5a1a47375c484e4d6c85201ad5b682130b1861040b4efd1b503269ccdfb8bce8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page