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.1.tar.gz (5.8 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.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for kalmanformer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dd63a3b67a99ad22034349823846432a940433153b778779c7e06378d1d22dd3
MD5 d354e1f13e2037c4a70d4526571b0193
BLAKE2b-256 415ba1e4abd0ce918191216e31fe99fac71217050c93231f85603bc4a3c830e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kalmanformer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea4ff145cd2911bb401a28ca77083e67475df516476ff5033af35560e414446b
MD5 a09cdb7a7dd227bc5c4688e3c067887e
BLAKE2b-256 49c9fba076551a661bf96e074736e8ed4ad16eaee217ecc3cc1efc19862c3b7f

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