baselines
==============================
### Installation
The `habitat_baselines` sub-package is NOT included upon installation by default. To install `habitat_baselines`, use the following command instead:
```bash
pip install -e habitat-lab
pip install -e habitat-baselines
```
This will also install additional requirements for each sub-module in `habitat_baselines/`, which are specified in `requirements.txt` files located in the sub-module directory.
### Reinforcement Learning (RL)
**Proximal Policy Optimization (PPO)**
**paper**: [https://arxiv.org/abs/1707.06347](https://arxiv.org/abs/1707.06347)
**code**: The PPO implementation is based on
[pytorch-a2c-ppo-acktr](https://github.com/ikostrikov/pytorch-a2c-ppo-acktr).
**dependencies**: A recent version of pytorch, for installing refer to [pytorch.org](https://pytorch.org/)
For training on sample data please follow steps in the repository README. You should download the sample [test scene data](http://dl.fbaipublicfiles.com/habitat/habitat-test-scenes.zip), extract it under the main repo (`habitat-lab/`, extraction will create a data folder at `habitat-lab/data`) and run the below training command.
**train**:
```bash
python -u -m habitat_baselines.run \
--config-name=pointnav/ppo_pointnav_example.yaml
```
You can reduce training time by changing the trainer from the default implement to [VER](rl/ver/README.md) by
setting `trainer_name` to `"ver"` in either the config or via the command line.
```bash
python -u -m habitat_baselines.run \
--config-name=pointnav/ppo_pointnav_example.yaml \
habitat_baselines.trainer_name=ver
```
**test**:
```bash
python -u -m habitat_baselines.run \
--config-name=pointnav/ppo_pointnav_example.yaml \
habitat_baselines.evaluate=True
```
We also provide trained RGB, RGBD, and Depth PPO models for MatterPort3D and Gibson.
To use them download pre-trained pytorch models from [link](https://dl.fbaipublicfiles.com/habitat/data/baselines/v1/habitat_baselines_v2.zip) and unzip and specify model path [here](agents/ppo_agents.py#L151).
The `habitat_baselines/config/pointnav/ppo_pointnav.yaml` config has better hyperparameters for large scale training and loads the [Gibson PointGoal Navigation Dataset](/README.md#datasets) instead of the test scenes.
Change the `/benchmark/nav/pointnav: pointnav_gibson` in `habitat_baselines/config/pointnav/ppo_pointnav.yaml` to `/benchmark/nav/pointnav: pointnav_mp3d` in the defaults list for training on [MatterPort3D PointGoal Navigation Dataset](/README.md#datasets).
### Hierarchical Reinforcement Learning (HRL)
We provide a two-layer hierarchical policy class, consisting of a low-level skill that moves the robot, and a high-level policy that reasons about which low-level skill to use in the current state. This can be especially powerful in long-horizon mobile manipulation tasks, like those introduced in [Habitat2.0](https://arxiv.org/abs/2106.14405). Both the low- and high- level can be either learned or an oracle. For oracle high-level we use [PDDL](https://planning.wiki/guide/whatis/pddl), and for oracle low-level we use instantaneous transitions, with the environment set to the final desired state. Additionally, for navigation, we provide an oracle navigation skill that uses A-star and the map of the environment to move the robot to its goal.
To run the following examples, you need the [ReplicaCAD dataset](https://github.com/facebookresearch/habitat-sim/blob/main/DATASETS.md#replicacad).
To train a high-level policy, while using pre-learned low-level skills (SRL baseline from [Habitat2.0](https://arxiv.org/abs/2106.14405)), you can run:
```bash
python -u -m habitat_baselines.run \
--config-name=rearrange/rl_hierarchical.yaml
```
To run a rearrangement episode with oracle low-level skills and a fixed task planner, run:
```bash
python -u -m habitat_baselines.run \
--config-name=rearrange/rl_hierarchical.yaml \
habitat_baselines.evaluate=True \
habitat_baselines/rl/policy=hl_fixed \
habitat_baselines/rl/policy/hierarchical_policy/defined_skills=oracle_skills
```
To change the task (like set table) that you train your skills on, you can change the line `/habitat/task/rearrange: rearrange_easy` to `/habitat/task/rearrange: set_table` in the defaults of your config.
### Additional Utilities
**Episode iterator options**:
Coming very soon
**Tensorboard and video generation support**
Enable tensorboard by changing `tensorboard_dir` field in `habitat_baselines/config/pointnav/ppo_pointnav.yaml`.
Enable video generation for `eval` mode by changing `video_option: tensorboard,disk` (for displaying on tensorboard and for saving videos on disk, respectively)
Generated navigation episode recordings should look like this on tensorboard:
<p align="center">
<img src="../../res/img/tensorboard_video_demo.gif" height="500">
</p>
Raw data
{
"_id": null,
"home_page": "https://aihabitat.org",
"name": "aihabitat-baselines",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Meta AI Research",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/90/03/6a05da62f7c1f0800b4f93eb72b5b9a396d70deb72b12074d56e881477ad/aihabitat-baselines-0.2.4.dev20230331.tar.gz",
"platform": null,
"description": "baselines\n==============================\n### Installation\n\nThe `habitat_baselines` sub-package is NOT included upon installation by default. To install `habitat_baselines`, use the following command instead:\n```bash\npip install -e habitat-lab\npip install -e habitat-baselines\n```\nThis will also install additional requirements for each sub-module in `habitat_baselines/`, which are specified in `requirements.txt` files located in the sub-module directory.\n\n\n### Reinforcement Learning (RL)\n\n**Proximal Policy Optimization (PPO)**\n\n**paper**: [https://arxiv.org/abs/1707.06347](https://arxiv.org/abs/1707.06347)\n\n**code**: The PPO implementation is based on\n[pytorch-a2c-ppo-acktr](https://github.com/ikostrikov/pytorch-a2c-ppo-acktr).\n\n**dependencies**: A recent version of pytorch, for installing refer to [pytorch.org](https://pytorch.org/)\n\nFor training on sample data please follow steps in the repository README. You should download the sample [test scene data](http://dl.fbaipublicfiles.com/habitat/habitat-test-scenes.zip), extract it under the main repo (`habitat-lab/`, extraction will create a data folder at `habitat-lab/data`) and run the below training command.\n\n**train**:\n```bash\npython -u -m habitat_baselines.run \\\n --config-name=pointnav/ppo_pointnav_example.yaml\n```\n\nYou can reduce training time by changing the trainer from the default implement to [VER](rl/ver/README.md) by\nsetting `trainer_name` to `\"ver\"` in either the config or via the command line.\n\n```bash\npython -u -m habitat_baselines.run \\\n --config-name=pointnav/ppo_pointnav_example.yaml \\\n habitat_baselines.trainer_name=ver\n```\n\n**test**:\n```bash\npython -u -m habitat_baselines.run \\\n --config-name=pointnav/ppo_pointnav_example.yaml \\\n habitat_baselines.evaluate=True\n```\n\nWe also provide trained RGB, RGBD, and Depth PPO models for MatterPort3D and Gibson.\nTo use them download pre-trained pytorch models from [link](https://dl.fbaipublicfiles.com/habitat/data/baselines/v1/habitat_baselines_v2.zip) and unzip and specify model path [here](agents/ppo_agents.py#L151).\n\nThe `habitat_baselines/config/pointnav/ppo_pointnav.yaml` config has better hyperparameters for large scale training and loads the [Gibson PointGoal Navigation Dataset](/README.md#datasets) instead of the test scenes.\nChange the `/benchmark/nav/pointnav: pointnav_gibson` in `habitat_baselines/config/pointnav/ppo_pointnav.yaml` to `/benchmark/nav/pointnav: pointnav_mp3d` in the defaults list for training on [MatterPort3D PointGoal Navigation Dataset](/README.md#datasets).\n\n### Hierarchical Reinforcement Learning (HRL)\n\nWe provide a two-layer hierarchical policy class, consisting of a low-level skill that moves the robot, and a high-level policy that reasons about which low-level skill to use in the current state. This can be especially powerful in long-horizon mobile manipulation tasks, like those introduced in [Habitat2.0](https://arxiv.org/abs/2106.14405). Both the low- and high- level can be either learned or an oracle. For oracle high-level we use [PDDL](https://planning.wiki/guide/whatis/pddl), and for oracle low-level we use instantaneous transitions, with the environment set to the final desired state. Additionally, for navigation, we provide an oracle navigation skill that uses A-star and the map of the environment to move the robot to its goal.\n\nTo run the following examples, you need the [ReplicaCAD dataset](https://github.com/facebookresearch/habitat-sim/blob/main/DATASETS.md#replicacad).\n\nTo train a high-level policy, while using pre-learned low-level skills (SRL baseline from [Habitat2.0](https://arxiv.org/abs/2106.14405)), you can run:\n\n```bash\npython -u -m habitat_baselines.run \\\n --config-name=rearrange/rl_hierarchical.yaml\n```\nTo run a rearrangement episode with oracle low-level skills and a fixed task planner, run:\n\n```bash\npython -u -m habitat_baselines.run \\\n --config-name=rearrange/rl_hierarchical.yaml \\\n habitat_baselines.evaluate=True \\\n habitat_baselines/rl/policy=hl_fixed \\\n habitat_baselines/rl/policy/hierarchical_policy/defined_skills=oracle_skills\n```\n\nTo change the task (like set table) that you train your skills on, you can change the line `/habitat/task/rearrange: rearrange_easy` to `/habitat/task/rearrange: set_table` in the defaults of your config.\n\n### Additional Utilities\n\n**Episode iterator options**:\nComing very soon\n\n**Tensorboard and video generation support**\n\nEnable tensorboard by changing `tensorboard_dir` field in `habitat_baselines/config/pointnav/ppo_pointnav.yaml`.\n\nEnable video generation for `eval` mode by changing `video_option: tensorboard,disk` (for displaying on tensorboard and for saving videos on disk, respectively)\n\nGenerated navigation episode recordings should look like this on tensorboard:\n<p align=\"center\">\n <img src=\"../../res/img/tensorboard_video_demo.gif\" height=\"500\">\n</p>\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Habitat-Baselines: Embodied AI baselines.",
"version": "0.2.4.dev20230331",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4d09ac081c75233e83fabdd5aa5c926fe8dec4613ad6a15e607ea9491f7e2212",
"md5": "e28502e27f47a7d2abc02b78e0cefd75",
"sha256": "405bc343292426bc818db85a9c7cf30f04a2d499a1929a6582f0acde5b3322c7"
},
"downloads": -1,
"filename": "aihabitat_baselines-0.2.4.dev20230331-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e28502e27f47a7d2abc02b78e0cefd75",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 196729,
"upload_time": "2023-03-30T21:17:41",
"upload_time_iso_8601": "2023-03-30T21:17:41.793031Z",
"url": "https://files.pythonhosted.org/packages/4d/09/ac081c75233e83fabdd5aa5c926fe8dec4613ad6a15e607ea9491f7e2212/aihabitat_baselines-0.2.4.dev20230331-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "90036a05da62f7c1f0800b4f93eb72b5b9a396d70deb72b12074d56e881477ad",
"md5": "3deaed0e6383533355af966095dbd55c",
"sha256": "b33c981795d01943febbd04d48cb807d56da9d973a8c9b65b847a6b9e7173b01"
},
"downloads": -1,
"filename": "aihabitat-baselines-0.2.4.dev20230331.tar.gz",
"has_sig": false,
"md5_digest": "3deaed0e6383533355af966095dbd55c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 143815,
"upload_time": "2023-03-30T21:17:43",
"upload_time_iso_8601": "2023-03-30T21:17:43.311212Z",
"url": "https://files.pythonhosted.org/packages/90/03/6a05da62f7c1f0800b4f93eb72b5b9a396d70deb72b12074d56e881477ad/aihabitat-baselines-0.2.4.dev20230331.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-30 21:17:43",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "aihabitat-baselines"
}