Baselines: Using Vectorized environement

Created on 12 Apr 2018  路  4Comments  路  Source: openai/baselines

env = DummyVecEnv([make_env]) env = VecNormalize(env)

Why using vectorized environement ? It returns observation values instead of the values returned by the environement class ( step function )

Any ideas, please ?

Most helpful comment

The vectorized environment simply wraps one or more gym.Env environments and runs them simultaneously. PPO2 is implemented to use a vectorized environment. So, if you want to use a single gym.Env, you have to use something like DummyVecEnv that makes the environment appear to be vectorized.

All 4 comments

The vectorized environment simply wraps one or more gym.Env environments and runs them simultaneously. PPO2 is implemented to use a vectorized environment. So, if you want to use a single gym.Env, you have to use something like DummyVecEnv that makes the environment appear to be vectorized.

What about the vecnormalize function?
If I am using a simple gym environment.
Should I use it??

I think VecNormalize is useful for some MuJoCo tasks, but it's definitely not a requirement.

@NourBesbes You should not use VecNormalize on pixels because most of the cnn policies already normalize images (dividing by 255), unless you only want to normalize reward (in that case, you should pass ob=False)
However, VecNormalize can be really useful for everything that is not pixels (e.g. joint space or [x,y,z] coordinates). Also, you have to save the running average if you want to play with a trained agent afterwards.

Vecnormalize computes a running average to estimate mean and std for observations and rewards.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nara0731 picture Nara0731  路  19Comments

pisiiki picture pisiiki  路  9Comments

scotthuang1989 picture scotthuang1989  路  7Comments

damienlancry picture damienlancry  路  7Comments

PolarisYxh picture PolarisYxh  路  10Comments