liruiw/lerobot

HPT LeRobot Implementation Version

16

stars

715

commits

Python

primary language

Sep 27, 2024

updated

liruiw.github.io/hpt

README

Heterogenous Pre-trained Transformers

HF Models License Paper Website Python PyTorch

Lirui Wang, Xinlei Chen, Jialiang Zhao, Kaiming He

Neural Information Processing Systems (Spotlight), 2024


This is a Huggingface LeRobot implementation for pre-training Heterogenous Pre-trained Transformers (HPTs).

LeRobot Installation

Create a virtual environment with Python 3.10 and activate it, e.g. with miniconda:

conda create -y -n lerobot python=3.10
conda activate lerobot

Install πŸ€— LeRobot with simulation environments:

pip install -e ".[aloha, pusht]

Code Modification Walkthrough

Check the following two folders for most of the modifications.

β”œβ”€β”€ lerobot
|   β”œβ”€β”€ configs          # contains hydra yaml files with all options that you can override in the command line
|   |   β”œβ”€β”€ ...            # various sim environments and their datasets: aloha.yaml, pusht.yaml, xarm.yaml
|   |   └── policy         # including policies config for hpt.yaml
|   β”œβ”€β”€ common           # contains classes and utilities
|   |   β”œβ”€β”€ ...       # various datasets of human demonstrations: aloha, pusht, xarm
|   |   β”œβ”€β”€ ...            # various sim environments: aloha, pusht, xarm
|   |   β”œβ”€β”€ policies       # including modeling and configuration for hpt
|   β”œβ”€β”€ ...

Experiment Scripts

  1. By default, the HPT model loads the x-large pre-trained trunk. Use these config parameters policy.embed_dim=256 policy.num_heads=8 policy.num_blocks=16 to switch to the hpt-base trunk for example.

  2. Run the following scripts for aloha transfer cube experiments.

Aloha Experiments
python lerobot/scripts/train.py \
policy=hpt_transformer env=aloha  env.task=AlohaTransferCube-v0 \
dataset_repo_id=lerobot/aloha_sim_transfer_cube_human \
wandb.enable=true
  1. Run the following scripts for push-T experiments.
PushT experiments
python lerobot/scripts/train.py \
policy=hpt_pusht  env=pusht  env.task=PushT-v0 \
dataset_repo_id=lerobot/pusht \
wandb.enable=true
  1. Run the following scripts for real-world Koch experiments.
Koch Experiments
python lerobot/scripts/train.py policy=hpt_koch_real env=koch_real \
dataset_repo_id=lerobot/koch_pick_place_5_lego  \
wandb.enable=true

Citation

If you find HPT useful in your research, please consider citing:

@inproceedings{wang2024hpt,
author    = {Lirui Wang, Xinlei Chen, Jialiang Zhao, Kaiming He, Russ Tedrake},
title     = {Scaling Proprioceptive-Visual Learning with Heterogeneous Pre-trained Transformers},
booktitle = {Neurips},
year      = {2024}
}

Acknowledgement

Our implementation is built upon the excellent LeRobot codebase.

Contributors

(top 30 of 34)

Cadene

210 commits

alexander-soare

195 commits

aliberts

168 commits

liruiw

95 commits

liruiw/lerobot

HPT LeRobot Implementation Version

16

stars

715

commits

Python

primary language

Sep 27, 2024

updated

liruiw.github.io/hpt

README

Heterogenous Pre-trained Transformers

HF Models License Paper Website Python PyTorch

Lirui Wang, Xinlei Chen, Jialiang Zhao, Kaiming He

Neural Information Processing Systems (Spotlight), 2024


This is a Huggingface LeRobot implementation for pre-training Heterogenous Pre-trained Transformers (HPTs).

LeRobot Installation

Create a virtual environment with Python 3.10 and activate it, e.g. with miniconda:

conda create -y -n lerobot python=3.10
conda activate lerobot

Install πŸ€— LeRobot with simulation environments:

pip install -e ".[aloha, pusht]

Code Modification Walkthrough

Check the following two folders for most of the modifications.

β”œβ”€β”€ lerobot
|   β”œβ”€β”€ configs          # contains hydra yaml files with all options that you can override in the command line
|   |   β”œβ”€β”€ ...            # various sim environments and their datasets: aloha.yaml, pusht.yaml, xarm.yaml
|   |   └── policy         # including policies config for hpt.yaml
|   β”œβ”€β”€ common           # contains classes and utilities
|   |   β”œβ”€β”€ ...       # various datasets of human demonstrations: aloha, pusht, xarm
|   |   β”œβ”€β”€ ...            # various sim environments: aloha, pusht, xarm
|   |   β”œβ”€β”€ policies       # including modeling and configuration for hpt
|   β”œβ”€β”€ ...

Experiment Scripts

  1. By default, the HPT model loads the x-large pre-trained trunk. Use these config parameters policy.embed_dim=256 policy.num_heads=8 policy.num_blocks=16 to switch to the hpt-base trunk for example.

  2. Run the following scripts for aloha transfer cube experiments.

Aloha Experiments
python lerobot/scripts/train.py \
policy=hpt_transformer env=aloha  env.task=AlohaTransferCube-v0 \
dataset_repo_id=lerobot/aloha_sim_transfer_cube_human \
wandb.enable=true
  1. Run the following scripts for push-T experiments.
PushT experiments
python lerobot/scripts/train.py \
policy=hpt_pusht  env=pusht  env.task=PushT-v0 \
dataset_repo_id=lerobot/pusht \
wandb.enable=true
  1. Run the following scripts for real-world Koch experiments.
Koch Experiments
python lerobot/scripts/train.py policy=hpt_koch_real env=koch_real \
dataset_repo_id=lerobot/koch_pick_place_5_lego  \
wandb.enable=true

Citation

If you find HPT useful in your research, please consider citing:

@inproceedings{wang2024hpt,
author    = {Lirui Wang, Xinlei Chen, Jialiang Zhao, Kaiming He, Russ Tedrake},
title     = {Scaling Proprioceptive-Visual Learning with Heterogeneous Pre-trained Transformers},
booktitle = {Neurips},
year      = {2024}
}

Acknowledgement

Our implementation is built upon the excellent LeRobot codebase.

Contributors

(top 30 of 34)

Cadene

210 commits

alexander-soare

195 commits

aliberts

168 commits

liruiw

95 commits

Languages

Python

97.2%

HTML

1.9%