Skip to content
Dev-EmbodiedAIPublic

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

LeMEM

LeMEM 是一个面向 LeRobot 0.6.0 与 pi0.5 的即插即用记忆模块。 它提供统一配置、数据适配、运行时包装、训练包装与离线预处理能力,可直接接入现有 LeRobot 训练流程。

LeMEM Architecture

核心能力

  • 统一管理不同记忆策略
  • 接入 pi0.5 训练与推理流程
  • 支持离线子目标预处理
  • 支持可替换的记忆选择、表示与融合模块
  • 提供模块化 Python 包与命令行入口

安装

方式一:开发态安装

cd <LEMEM_ROOT>
python -m pip install -e .

方式二:仅安装当前包

cd <LEMEM_ROOT>
python -m pip install .

如果你的环境里已经有 LeRobot 0.6.0、pi0.5 及其依赖,LeMEM 可作为补丁包直接安装。

快速开始

from lerobot_policy_lemem import (
    LeMEMConfig,
    attach_lemem_to_trainer,
    build_LeMEM_finetune_plan,
    build_LeMEM_pi05_training_components,
    make_lemem_trainer_bundle,
    wrap_with_lemem,
)

config = LeMEMConfig.from_LeMEM_profile("perceptual-framesamp-modul", num_memory_frames=8)
plan = build_LeMEM_finetune_plan(config=config)
dataset, pi05_config, preprocessor, postprocessor = build_LeMEM_pi05_training_components(plan=plan)

接入方式

1. 包装现有 pi0.5 policy

policy = wrap_with_lemem(pi05_policy, config, dataset_stats=dataset.meta.stats)

2. 构建训练包装层

bundle = make_lemem_trainer_bundle(pi05_policy, config, dataset_stats=dataset.meta.stats)
bundle.build_processors(pi05_config)
bundle.install_runtime()
policy = bundle.policy

3. 挂到 trainer

bundle = attach_lemem_to_trainer(trainer, pi05_policy, config)

记忆机制

感知记忆

  • perceptual-framesamp-context
  • perceptual-framesamp-modul
  • perceptual-tokendrop-context
  • perceptual-tokendrop-modul

循环记忆

  • recurrent-rmt-context
  • recurrent-rmt-modul
  • recurrent-ttt-context
  • recurrent-ttt-modul

符号记忆

  • symbolic-simple-subgoal
  • symbolic-grounded-subgoal

结构化记忆

  • bridgevla_spatiotemporal

基础选择器

  • frame_stack
  • last_n
  • nearest
  • retrieval
  • reservoir
  • recency_retrieval
  • score_decay

命令行

打印训练计划

lemem-plan --profile perceptual-framesamp-modul --num-memory-frames 8 --max-siglip-frames 4
# Use only when GPU memory is sufficient for the 32-frame benchmark window:
lemem-plan --profile perceptual-framesamp-modul --full-memory-32 --max-siglip-frames 4

Note: num_memory_frames controls the history window, while LeMEM_max_siglip_frames / --max-siglip-frames caps the number of frames actually encoded by SigLIP. Historical memory vision encoding is frozen by default, so training updates LeMEM memory/modulation parameters without pushing every 32-frame history window through the vision tower with gradients.

生成离线子目标

lemem-subgoal --help

运行离线预处理

lemem-preprocess --help

目录

  • src/lerobot_policy_lemem/:源码
  • tests/:单元测试
  • docs/diagrams/:机制图

开发检查

python -m compileall -q src tests
python -m unittest discover -s tests -v

说明

  • 默认推荐配置为 perceptual-framesamp-modul
  • symbolic-simple-subgoal 和 symbolic-grounded-subgoal 走符号记忆路径
  • bridgevla_spatiotemporal 走结构化字段路径

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages