Adding num_env to readme example (#609)

* Adding num_env to readme example

* Updated readme example fix
This commit is contained in:
ahuhn
2018-09-21 17:22:56 -07:00
committed by pzhokhov
parent 8158f35611
commit 555a5cbbb2

View File

@@ -222,7 +222,7 @@ def main():
env = build_env(args) env = build_env(args)
obs = env.reset() obs = env.reset()
def initialize_placeholders(nlstm=128,**kwargs): def initialize_placeholders(nlstm=128,**kwargs):
return np.zeros((args.num_env, 2*nlstm)), np.zeros((1)) return np.zeros((args.num_env or 1, 2*nlstm)), np.zeros((1))
state, dones = initialize_placeholders(**extra_args) state, dones = initialize_placeholders(**extra_args)
while True: while True:
actions, _, state, _ = model.step(obs,S=state, M=dones) actions, _, state, _ = model.step(obs,S=state, M=dones)