remove tensorflow dependency from VecEnv
This commit is contained in:
committed by
Jacob Hilton
parent
f2654082b2
commit
cc88c8e4c0
@@ -1,8 +1,6 @@
|
|||||||
from . import VecEnvWrapper
|
from . import VecEnvWrapper
|
||||||
from baselines.common.running_mean_std import RunningMeanStd
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
class VecNormalize(VecEnvWrapper):
|
class VecNormalize(VecEnvWrapper):
|
||||||
"""
|
"""
|
||||||
A vectorized wrapper that normalizes the observations
|
A vectorized wrapper that normalizes the observations
|
||||||
@@ -11,6 +9,7 @@ class VecNormalize(VecEnvWrapper):
|
|||||||
|
|
||||||
def __init__(self, venv, ob=True, ret=True, clipob=10., cliprew=10., gamma=0.99, epsilon=1e-8):
|
def __init__(self, venv, ob=True, ret=True, clipob=10., cliprew=10., gamma=0.99, epsilon=1e-8):
|
||||||
VecEnvWrapper.__init__(self, venv)
|
VecEnvWrapper.__init__(self, venv)
|
||||||
|
from baselines.common.running_mean_std import RunningMeanStd
|
||||||
self.ob_rms = RunningMeanStd(shape=self.observation_space.shape) if ob else None
|
self.ob_rms = RunningMeanStd(shape=self.observation_space.shape) if ob else None
|
||||||
self.ret_rms = RunningMeanStd(shape=()) if ret else None
|
self.ret_rms = RunningMeanStd(shape=()) if ret else None
|
||||||
self.clipob = clipob
|
self.clipob = clipob
|
||||||
|
Reference in New Issue
Block a user