-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #789 from StanfordVL/doc-update-multiple-envs
Doc update multiple envs
- Loading branch information
Showing
6 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
icon: octicons/stack-16 | ||
--- | ||
|
||
# 🌌 **Vector Environments** | ||
|
||
## Description | ||
|
||
To support large-scale parallelization, we now support vector environments. Each environment is similar to our regular [environment](./environments.md), but our simulator now can keep track of multiple environments simultaneously. We have implemented many vectorized operations to optimize the performance of these parallel environments. We are also actively working on further enhancements to make them faster. Some use cases for this include reinforcement learning, parallelized training with domain randomization, and parallelized policy evaluation. | ||
|
||
## Usage | ||
|
||
Creating a minimal vector environment requires the definition of a config dictionary. This dictionary is copied across all environments: | ||
|
||
??? code "vec_env_simple.py" | ||
``` python linenums="1" | ||
import omnigibson as og | ||
cfg = { | ||
"scene": { | ||
"type": "InteractiveTraversableScene", | ||
"scene_model": "Rs_int", | ||
"load_object_categories": ["floors", "walls"], | ||
}, | ||
"objects": [], | ||
"robots": [ | ||
{ | ||
"type": "Fetch", | ||
"obs_modalities": [], | ||
} | ||
] | ||
} | ||
|
||
vec_env = og.VectorEnvironment(num_envs=3, config=cfg) | ||
actions = [...] | ||
observations, rewards, terminates, truncates, infos = vec_env.step(actions) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters