Skip to content

Commit 62ed2de

Browse files
authored
Merge pull request #14 from ARISE-Initiative/0.2.0
0.2.0
2 parents 2804dd9 + 817b65c commit 62ed2de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+4230
-1498
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
-------
1717
## Latest Updates
18-
[08/09/2021] **v0.1.0**: Initial code and paper release
18+
- [12/16/2021] **v0.2.0**: Modular observation modalities and encoders :wrench:, support for [MOMART](https://sites.google.com/view/il-for-mm/home) datasets :open_file_folder:
19+
- [08/09/2021] **v0.1.0**: Initial code and paper release
1920

2021
-------
2122

@@ -24,10 +25,11 @@
2425
Imitating human demonstrations is a promising approach to endow robots with various manipulation capabilities. While recent advances have been made in imitation learning and batch (offline) reinforcement learning, a lack of open-source human datasets and reproducible learning methods make assessing the state of the field difficult. The overarching goal of **robomimic** is to provide researchers and practitioners with:
2526

2627
- a **standardized set of large demonstration datasets** across several benchmarking tasks to facilitate fair comparisons, with a focus on learning from human-provided demonstrations
28+
- a **standardized set of large demonstration datasets** across several benchmarking tasks to facilitate fair comparisons, with a focus on learning from human-provided demonstrations (see [this link](https://arise-initiative.github.io/robomimic-web/docs/introduction/quickstart.html#supported-datasets) for a list of supported datasets)
2729
- **high-quality implementations of several learning algorithms** for training closed-loop policies from offline datasets to make reproducing results easy and lower the barrier to entry
2830
- a **modular design** that offers great flexibility in extending algorithms and designing new algorithms
2931

30-
This release of **robomimic** contains seven offline learning [algorithms](https://arise-initiative.github.io/robomimic-web/docs/modules/algorithms.html) and standardized [datasets](https://arise-initiative.github.io/robomimic-web/docs/introduction/results.html) collected across five simulated and three real-world multi-stage manipulation tasks of varying complexity. We highlight some features below:
32+
This release of **robomimic** contains seven offline learning [algorithms](https://arise-initiative.github.io/robomimic-web/docs/modules/algorithms.html) and standardized [datasets](https://arise-initiative.github.io/robomimic-web/docs/introduction/results.html) collected across five simulated and three real-world multi-stage manipulation tasks of varying complexity. We highlight some features below (for a more thorough list of features, see [this link](https://arise-initiative.github.io/robomimic-web/docs/introduction/quickstart.html#features-overview)):
3133

3234
- **standardized datasets:** a set of datasets collected from different sources (single proficient human, multiple humans, and machine-generated) across several simulated and real-world tasks, along with a plug-and-play [Dataset class](https://arise-initiative.github.io/robomimic-web/docs/modules/datasets.html) to easily use the datasets outside of this project
3335
- **algorithm implementations:** several high-quality implementations of offline learning algorithms, including BC, BC-RNN, HBC, IRIS, BCQ, CQL, and TD3-BC

docs/api/robomimic.envs.rst

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ robomimic.envs.env\_gym module
2020
:undoc-members:
2121
:show-inheritance:
2222

23+
robomimic.envs.env\_ig\_momart module
24+
-------------------------------------
25+
26+
.. automodule:: robomimic.envs.env_ig_momart
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
2331
robomimic.envs.env\_robosuite module
2432
------------------------------------
2533

docs/api/robomimic.utils.rst

+16
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ robomimic.utils.loss\_utils module
5252
:undoc-members:
5353
:show-inheritance:
5454

55+
robomimic.utils.macros module
56+
-----------------------------
57+
58+
.. automodule:: robomimic.utils.macros
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
62+
5563
robomimic.utils.obs\_utils module
5664
---------------------------------
5765

@@ -60,6 +68,14 @@ robomimic.utils.obs\_utils module
6068
:undoc-members:
6169
:show-inheritance:
6270

71+
robomimic.utils.python\_utils module
72+
------------------------------------
73+
74+
.. automodule:: robomimic.utils.python_utils
75+
:members:
76+
:undoc-members:
77+
:show-inheritance:
78+
6379
robomimic.utils.tensor\_utils module
6480
------------------------------------
6581

docs/images/modules.png

-158 KB
Loading

docs/images/momart_bowl_in_sink.png

371 KB
Loading

docs/images/momart_dump_trash.png

397 KB
Loading

docs/images/momart_grab_bowl.png

491 KB
Loading
285 KB
Loading

docs/images/momart_open_dresser.png

464 KB
Loading
Loading
Loading
Loading
Loading
Loading

docs/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Welcome to robomimic's documentation!
1313
introduction/overview
1414
introduction/installation
1515
introduction/quickstart
16+
introduction/features
1617
introduction/advanced
1718
introduction/examples
1819
introduction/datasets
@@ -25,6 +26,7 @@ Welcome to robomimic's documentation!
2526

2627
modules/overview
2728
modules/dataset
29+
modules/observations
2830
modules/algorithms
2931
modules/models
3032
modules/configs

docs/introduction/datasets.md

+22-3
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ data (group)
3030

3131
- `dones` (dataset) - done signal, equal to 1 if playing the corresponding action in the state should terminate the episode. Shape (N,) where N is the length of the trajectory.
3232

33-
- `obs` (group) - group for the observation modalities. Each modality is stored as a dataset.
33+
- `obs` (group) - group for the observation keys. Each key is stored as a dataset.
3434

35-
- `<modality_1>` (dataset) - the first observation modality. Note that the name of this dataset and shape will vary. As an example, the name could be "agentview_image", and the shape could be (N, 84, 84, 3).
35+
- `<obs_key_1>` (dataset) - the first observation key. Note that the name of this dataset and shape will vary. As an example, the name could be "agentview_image", and the shape could be (N, 84, 84, 3).
3636

3737
...
3838

3939
- `next_obs` (group) - group for the next observations.
4040

41-
- `<modality_1>` (dataset) - the first observation modality.
41+
- `<obs_key_1>` (dataset) - the first observation key.
4242

4343
...
4444

@@ -169,6 +169,25 @@ For more details on how the released `demo.hdf5` dataset files were used to gene
169169

170170

171171

172+
## MOMART Datasets
173+
174+
<p align="center">
175+
<img width="19.0%" src="../images/momart_table_setup_from_dishwasher_overview.png">
176+
<img width="19.0%" src="../images/momart_table_setup_from_dresser_overview.png">
177+
<img width="19.0%" src="../images/momart_table_cleanup_to_dishwasher_overview.png">
178+
<img width="19.0%" src="../images/momart_table_cleanup_to_sink_overview.png">
179+
<img width="19.0%" src="../images/momart_unload_dishwasher_to_dresser_overview.png">
180+
<img width="19.0%" src="../images/momart_bowl_in_sink.png">
181+
<img width="19.0%" src="../images/momart_dump_trash.png">
182+
<img width="19.0%" src="../images/momart_grab_bowl.png">
183+
<img width="19.0%" src="../images/momart_open_dishwasher.png">
184+
<img width="19.0%" src="../images/momart_open_dresser.png">
185+
</p>
186+
187+
This repository is fully compatible with [MOMART](https://sites.google.com/view/il-for-mm/home) datasets, a large collection of long-horizon, multi-stage simulated kitchen tasks executed by a mobile manipulator robot. See [this link](https://sites.google.com/view/il-for-mm/datasets) for a breakdown of the MOMART dataset structure, guide on downloading MOMART datasets, and running experiments using the datasets.
188+
189+
190+
172191
## D4RL Datasets
173192

174193
This repository is fully compatible with most [D4RL](https://github.com/rail-berkeley/d4rl) datasets. See [this link](./results.html#d4rl) for a guide on downloading D4RL datasets and running D4RL experiments.

docs/introduction/examples.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,10 @@ Please see the [Config documentation](../modules/configs.html) for more informat
153153

154154
## Observation Networks Example
155155

156-
The example script in `examples/simple_obs_net.py` discusses how to construct networks for taking observation dictionaries as input, and that produce dictionaries as outputs. See [this section](../modules/models.html#observation-encoder-and-decoder) in the documentation for more details.
156+
The example script in `examples/simple_obs_net.py` discusses how to construct networks for taking observation dictionaries as input, and that produce dictionaries as outputs. See [this section](../modules/models.html#observation-encoder-and-decoder) in the documentation for more details.
157+
158+
159+
160+
## Custom Observation Modalities Example
161+
162+
The example script in `examples/add_new_modality.py` discusses how to (a) modify pre-existing observation modalities, and (b) add your own custom observation modalities with custom encoding. See [this section](../modules/models.html#observation-encoder-and-decoder) in the documentation for more details about the encoding and decoding process.

docs/introduction/features.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Features Overview
2+
3+
## Summary
4+
5+
In this section, we briefly summarize some key features and where you should look to learn more about them.
6+
7+
1. **Datasets supported by robomimic**
8+
- See a list of supported datasets [here](./features.html#supported-datasets).<br><br>
9+
2. **Visualizing datasets**
10+
- Learn how to visualize dataset trajectories [here](./datasets.html#view-dataset-structure-and-videos).<br><br>
11+
3. **Reproducing paper experiments**
12+
- Easily reproduce experiments from the following papers
13+
- robomimic: [here](./results.html)
14+
- MOMART: [here](https://sites.google.com/view/il-for-mm/datasets)<br><br>
15+
4. **Making your own dataset**
16+
- Learn how to make your own collected dataset compatible with this repository [here](./datasets.html#dataset-structure).
17+
- Note that **all datasets collected through robosuite are also readily compatible** (see [here](./datasets.html#converting-robosuite-hdf5-datasets)).<br><br>
18+
5. **Using filter keys to easily train on subsets of a dataset**
19+
- See [this section](./datasets.html#filter-keys-and-train-valid-splits) on how to use filter keys.<br><br>
20+
6. **Running hyperparameter scans easily**
21+
- See [this guide](./advanced.html#using-the-hyperparameter-helper-to-launch-runs) on running hyperparameter scans.<br><br>
22+
7. **Using pretrained models in the model zoo**
23+
- See [this link](./model_zoo.html) to download and use pretrained models.<br><br>
24+
8. **Getting familiar with configs**
25+
- Learn about how configs work [here](../modules/configs.html).<br><br>
26+
9. **Getting familiar with operations over tensor collections**
27+
- Learn about using useful tensor utilities [here](../modules/utils.html#tensorutils).<br><br>
28+
10. **Creating your own observation modalities**
29+
- Learn how to make your own observation modalities and process them with custom network architectures [here](../modules/observations.html).<br><br>
30+
11. **Creating your own algorithm**
31+
- Learn how to implement your own learning algorithm [here](../modules/algorithms.html#building-your-own-algorithm).<br><br>
32+
33+
## Supported Datasets
34+
35+
This is a list of datasets that we currently support, along with links on how to work with them. This list will be expanded as more datasets are made compatible with robomimic.
36+
37+
- [robomimic](./results.html#downloading-released-datasets)
38+
- [robosuite](./datasets.html#converting-robosuite-hdf5-datasets)
39+
- [MOMART](./datasets.html#momart-datasets)
40+
- [D4RL](./results.html#d4rl)
41+
- [RoboTurk Pilot](./datasets.html#roboturk-pilot-datasets)

docs/introduction/overview.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
Imitating human demonstrations is a promising approach to endow robots with various manipulation capabilities. While recent advances have been made in imitation learning and batch (offline) reinforcement learning, a lack of open-source human datasets and reproducible learning methods make assessing the state of the field difficult. The overarching goal of **robomimic** is to provide researchers and practitioners with:
1717

18-
- a **standardized set of large demonstration datasets** across several benchmarking tasks to facilitate fair comparisons, with a focus on learning from human-provided demonstrations
18+
- a **standardized set of large demonstration datasets** across several benchmarking tasks to facilitate fair comparisons, with a focus on learning from human-provided demonstrations (see [this link](./features.html#supported-datasets) for a list of supported datasets)
1919
- **high-quality implementations of several learning algorithms** for training closed-loop policies from offline datasets to make reproducing results easy and lower the barrier to entry
2020
- a **modular design** that offers great flexibility in extending algorithms and designing new algorithms
2121

22-
This release of **robomimic** contains seven offline learning [algorithms](../modules/algorithms.html) and standardized [datasets](./results.html) collected across five simulated and three real-world multi-stage manipulation tasks of varying complexity. We highlight some features below:
22+
This release of **robomimic** contains seven offline learning [algorithms](../modules/algorithms.html) and standardized [datasets](./results.html) collected across five simulated and three real-world multi-stage manipulation tasks of varying complexity. We highlight some features below (for a more thorough list of features, see [this link](./features.html#features-overview)):
2323

2424
- **standardized datasets:** a set of datasets collected from different sources (single proficient human, multiple humans, and machine-generated) across several simulated and real-world tasks, along with a plug-and-play [Dataset class](../modules/datasets.html) to easily use the datasets outside of this project
2525
- **algorithm implementations:** several high-quality implementations of offline learning algorithms, including BC, BC-RNN, HBC, IRIS, BCQ, CQL, and TD3-BC

docs/introduction/quickstart.md

-3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,3 @@ Instead of storing the observations, which can consist of high-dimensional image
108108
```sh
109109
python run_trained_agent.py --agent /path/to/model.pth --n_rollouts 50 --horizon 400 --seed 0 --dataset_path /path/to/output.hdf5
110110
```
111-
112-
113-

docs/introduction/results.md

+18
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ $ python train.py --config ../exps/paper/core/lift/ph/low_dim/bc.json
2222

2323
See the [downloading released datasets](./results.html#downloading-released-datasets) section below for more information on downloading different datasets, and the [results on released datasets](./results.html#results-on-released-datasets) section below for more detailed information on reproducing different results from the study.
2424

25+
## Quick Example
26+
27+
In this section, we show a simple example of how to reproduce one of the results from the study - the BC-RNN result on the Lift (Proficient-Human) low-dim dataset.
28+
29+
```sh
30+
# default behavior for download script - just download lift proficient-human low-dim dataset to robomimic/../datasets
31+
$ python download_datasets.py
32+
33+
# generate json configs for running all experiments at robomimic/exps/paper
34+
$ python generate_paper_configs.py --output_dir /tmp/experiment_results
35+
36+
# the training command can be found in robomimic/exps/paper/core.sh
37+
# Training results can be viewed at /tmp/experiment_results (--output_dir when generating paper configs).
38+
$ python train.py --config ../exps/paper/core/lift/ph/low_dim/bc.json
39+
```
40+
41+
See the [downloading released datasets](./results.html#downloading-released-datasets) section below for more information on downloading different datasets, and the [results on released datasets](./results.html#results-on-released-datasets) section below for more detailed information on reproducing different results from the study.
42+
2543
## Downloading Released Datasets
2644

2745
Released datasets can be downloaded easily by using the `download_datasets.py` script. **This is the preferred method for downloading the datasets**, because the script will also set up a directory structure for the datasets that works out of the box with examples for reproducing some benchmark results with the repository. A few examples of using this script are provided below.

docs/miscellaneous/contributing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ We also list additional suggested contributing guidelines that we adhered to dur
4343

4444
- When creating new networks (e.g. subclasses of `Module` in `models/base_nets.py`), always sub-modules into a property called `self.nets`, and if there is more than one sub-module, make it a module collection (such as a `torch.nn.ModuleDict`). This is to ensure that the pattern `model.to(device)` works as expected with multiple levels of nested torch modules. As an example of nesting, see the `_create_networks` function in the `VAE` class (`models/vae_nets.py`) and the `MIMO_MLP` class (`models/obs_nets.py`).
4545

46-
- Do not use default mutable arguments -- they can lead to terrible bugs and unexpected behavior (see [this link](https://florimond.dev/blog/articles/2018/08/python-mutable-defaults-are-the-source-of-all-evil/) for more information). For this reason, in functions that expect optional dictionaries and lists (for example, the `visual_core_kwargs` argument in the `obs_encoder_factory` function, or the `layer_dims` argument in the `MLP` class constructor), we use a default argument of `visual_core_kwargs=None` or an empty tuple (since tuples are immutable) `layer_dims=()`.
46+
- Do not use default mutable arguments -- they can lead to terrible bugs and unexpected behavior (see [this link](https://florimond.dev/blog/articles/2018/08/python-mutable-defaults-are-the-source-of-all-evil/) for more information). For this reason, in functions that expect optional dictionaries and lists (for example, the `core_kwargs` argument in the `obs_encoder_factory` function, or the `layer_dims` argument in the `MLP` class constructor), we use a default argument of `core_kwargs=None` or an empty tuple (since tuples are immutable) `layer_dims=()`.
4747

4848
- Prefer `torch.expand` over `torch.repeat` wherever possible, for memory efficiency. See [this link](https://discuss.pytorch.org/t/expand-vs-repeat-semantic-difference/59789) for more details.
4949

docs/miscellaneous/references.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ A list of projects and papers that use **robomimic**. If you would like to add y
88

99
## Imitation Learning and Batch (Offline) Reinforcement Learning
1010

11+
- [Error-Aware Imitation Learning from Teleoperation Data for Mobile Manipulation](https://arxiv.org/abs/2112.05251) Josiah Wong, Albert Tung, Andrey Kurenkov, Ajay Mandlekar, Li Fei-Fei, Silvio Savarese, Roberto Martín-Martín
1112
- [Generalization Through Hand-Eye Coordination: An Action Space for Learning Spatially-Invariant Visuomotor Control](https://arxiv.org/abs/2103.00375) Chen Wang, Rui Wang, Danfei Xu, Ajay Mandlekar, Li Fei-Fei, Silvio Savarese
1213
- [Human-in-the-Loop Imitation Learning using Remote Teleoperation](https://arxiv.org/abs/2012.06733) Ajay Mandlekar, Danfei Xu, Roberto Martín-Martín, Yuke Zhu, Li Fei-Fei, Silvio Savarese
1314
- [Learning Multi-Arm Manipulation Through Collaborative Teleoperation](https://arxiv.org/abs/2012.06738) Albert Tung, Josiah Wong, Ajay Mandlekar, Roberto Martín-Martín, Yuke Zhu, Li Fei-Fei, Silvio Savarese

docs/modules/algorithms.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ config, _ = config_from_checkpoint(algo_name=algo_name, ckpt_dict=ckpt_dict)
141141
model = algo_factory(
142142
algo_name,
143143
config,
144-
modality_shapes=ckpt_dict["shape_metadata"]["all_shapes"],
144+
obs_key_shapes=ckpt_dict["shape_metadata"]["all_shapes"],
145145
ac_dim=ckpt_dict["shape_metadata"]["ac_dim"],
146146
device=device,
147147
)

docs/modules/dataset.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dataset = SequenceDataset(
3030
- `hdf5_path`
3131
- The absolute / relative path to the hdf5 file containing training demonstrations. See [datasets](../introduction/datasets.html) page for the expected data structure.
3232
- `obs_keys`
33-
- A list of strings specifying which observation modalities to read from the dataset. This is typically read from the config file: our implementation pools observation keys from `config.observation.modalities.obs.low_dim` and `config.observation.modalities.obs.images`.
33+
- A list of strings specifying which observation modalities to read from the dataset. This is typically read from the config file: our implementation pools observation keys from `config.observation.modalities.obs.low_dim` and `config.observation.modalities.obs.rgb`.
3434
- `dataset_keys`
3535
- Keys of non-observation data to read from a demonstration. Typically include `actions`, `rewards`, `dones`.
3636
- `seq_length`

0 commit comments

Comments
 (0)