This commit is contained in:
Peter Zhokhov
2018-09-11 13:21:52 -07:00
parent 4e2a888273
commit 1f99a562e3
3 changed files with 7 additions and 7 deletions

View File

@@ -25,9 +25,9 @@ class NotSteppingError(Exception):
class VecEnv(ABC):
"""
An abstract asynchronous, vectorized environment.
An abstract asynchronous, vectorized environment.
Used to batch data from multiple copies of an environment, so that
each observation becomes an batch of observations, and expected action is a batch of actions to
each observation becomes an batch of observations, and expected action is a batch of actions to
be applied per-environment.
"""

View File

@@ -7,14 +7,14 @@ class DummyVecEnv(VecEnv):
"""
VecEnv that does runs multiple environments sequentially, that is,
the step and reset commands are send to one environment at a time.
Useful when debugging and when num_env == 1 (in the latter case,
Useful when debugging and when num_env == 1 (in the latter case,
avoids communication overhead)
"""
def __init__(self, env_fns):
"""
Arguments:
env_fns: iterable of callables functions that build environments
env_fns: iterable of callables functions that build environments
"""
self.envs = [fn() for fn in env_fns]
env = self.envs[0]

View File

@@ -33,8 +33,8 @@ def worker(remote, parent_remote, env_fn_wrapper):
class SubprocVecEnv(VecEnv):
"""
VecEnv that runs multiple environments in parallel in subproceses and communicates with them via pipes.
Recommended to use when num_envs > 1 and step() can be a bottleneck.
VecEnv that runs multiple environments in parallel in subproceses and communicates with them via pipes.
Recommended to use when num_envs > 1 and step() can be a bottleneck.
"""
def __init__(self, env_fns, spaces=None):
"""