How xuejifang/lewam works
LeWAM is a robot manipulation policy that combines frozen I-JEPA visual features with a Transformer to generate action sequences, then evaluates the policy in RoboTwin. The main runtime path is RoboTwin evaluation through the LeWAM policy adapter, camera preprocessing, and pipeline inference, followed by actions applied to the simulation. Internally, the pipeline uses the vision adapter, predictor, and inference optimizations. The README also documents joint future-world prediction, AdaFuse, and DemoDPO; source excerpts establish the first two implementation areas but do not show DemoDPO internals. Some evaluation orchestration details are unsampled, so those links are omitted.
Main entry points: pipeline_lewam.py LeWAM Pipeline · deploy_policy.py RobotWin Policy · lewam_model.py Joint Action and World Predictor · eval_robotwin_single.py Single-Task Evaluator
Components 15
RoboTwin Evaluation
- Evaluation Manager
experiments/robotwin/run_robotwin_manager.py - Single-Task Evaluator
experiments/robotwin/eval_robotwin_single.py
Policy Inference
- RobotWin Policy
experiments/robotwin/lewam_policy/deploy_policy.py - Image and Stats Helpers
experiments/robotwin/image_utils.py
LeWAM Model
- LeWAM Pipeline
lewam/pipelines/lewam/pipeline_lewam.py - Vision Encoder and AdaFuse
lewam/models/vision_encoder.py - Joint Action and World Predictor
lewam/models/lewam_model.py - Transformer Blocks
lewam/models/module.py - 3D Rotary Positions
lewam/models/rope.py - Sparse Future Offsets
lewam/models/sparse_offsets.py - DemoDPO Refinement
lewam/models
Inference Support
- Visual KV Cache
lewam/models/action_cache.py - CUDA Graph Replay
lewam/pipelines/lewam/cuda_graph.py
Other components
- Evaluation User
- RoboTwin Simulator
Connections 18
- Evaluation User → Evaluation Manager: starts evaluation
README.md - Evaluation Manager → Single-Task Evaluator
- Single-Task Evaluator → RobotWin Policy: loads policy
experiments/robotwin/eval_robotwin_single.py - Single-Task Evaluator → RoboTwin Simulator: runs task
- RobotWin Policy → Image and Stats Helpers: prepares images and stats
experiments/robotwin/lewam_policy/deploy_policy.py - RobotWin Policy → LeWAM Pipeline: requests actions
experiments/robotwin/lewam_policy/deploy_policy.py - RobotWin Policy → RoboTwin Simulator: sends actions
experiments/robotwin/lewam_policy/deploy_policy.py - LeWAM Pipeline → Vision Encoder and AdaFuse: encodes observations
lewam/pipelines/lewam/pipeline_lewam.py - LeWAM Pipeline → Joint Action and World Predictor: predicts actions and futures
lewam/pipelines/lewam/pipeline_lewam.py - LeWAM Pipeline → Sparse Future Offsets: normalizes offsets
lewam/pipelines/lewam/pipeline_lewam.py - LeWAM Pipeline → Visual KV Cache: uses cached inference
lewam/pipelines/lewam/pipeline_lewam.py - LeWAM Pipeline → CUDA Graph Replay: uses graph replay
lewam/pipelines/lewam/pipeline_lewam.py - Joint Action and World Predictor → Transformer Blocks: builds transformer
lewam/models/lewam_model.py - Joint Action and World Predictor → 3D Rotary Positions: uses rotary positions
lewam/models/lewam_model.py - Joint Action and World Predictor → Sparse Future Offsets: normalizes offsets
lewam/models/lewam_model.py - 3D Rotary Positions → Sparse Future Offsets: normalizes offsets
lewam/models/rope.py - Visual KV Cache → Transformer Blocks: reuses block operations
lewam/models/action_cache.py - Visual KV Cache → 3D Rotary Positions: builds rotary positions
lewam/models/action_cache.py