How haleqiu/airimu works
Project Type and Purpose
• AirIMU is a machine‐learning pipeline for inertial odometry with uncertainty propagation.
• It trains, infers, and evaluates a neural model that takes raw IMU (accelerometer + gyroscope) sequences as input and outputs state estimates (e.g., velocity) and their uncertainties.
High‐Level File/Module Structure
• configs/…
• datasets/… – dataset‐specific settings (paths, sampling rates, window sizes)
• exp/… – experiment configurations (which dataset + model hyperparameters)
• train/ – global training config (e.g., default seqlen)
• datasets/… – PyTorch‐style Dataset classes that load raw IMU + ground‐truth pose/velocity
• model/… – network definitions
• net.py – overall network class
• cnn.py – convolutional feature extractor
• code.py – uncertainty‐code layers
• loss_func.py & losses.py – training objectives
• train.py – entry point for training (loads config → dataset → model → optimizer → loop)
• inference.py – runs a forward pass on test sequences, writes net_output.pickle
• evaluation/evaluate_state.py – consumes net_output.pickle + ground truth to produce metrics
• utils/… – helpers for differentiation, integration, visualization
Main Components and Data Flow
[Configs] → [Dataset Loader] → [DataLoader (PyTorch)] → [Model (net.py)] →
[Loss Computation] → [Optimizer/Checkpointing] → [Inference] → [Evaluation]
Inputs and Outputs of the Model
a. Input “X”:
• B = batch size (e.g., 32)
• T = sequence length (configurable, e.g., 200 timesteps)
• 6 channels: [ax, ay, az, wx, wy, wz]
– ax, ay, az in m/s²;
– wx, wy, wz in rad/s
• Optionally, initial orientation/state if configured (e.g., gravity vector).
b. Output “Y”:
• D = state dimension (e.g., 3 velocities + code dims for covariance)
• Uncertainty codes or covariance matrices (embedded within a code vector of size C).
• At inference, outputs are dumped to net_output.pickle for later evaluation.
Key Architectural Patterns and Principles
• Modular separation of concerns:
• Configuration ←→ Data IO ←→ Model ←→ Loss ←→ Training Loop
• PyTorch + pypose for automatic differentiation on SE(3)/rotation manifolds
• Experiment reproducibility via structured config files under configs/exp and configs/datasets
• Logging integration with wandb (optional via --log)
Detailing the Input Format
• Model → Output as: