rename model.step_as_dict
with model.step_with_dict
.
This commit is contained in:
@@ -137,7 +137,7 @@ class Model(object):
|
|||||||
if MPI is not None:
|
if MPI is not None:
|
||||||
sync_from_root(sess, global_variables) # pylint: disable=E1101
|
sync_from_root(sess, global_variables) # pylint: disable=E1101
|
||||||
|
|
||||||
def step_as_dict(self, **kwargs):
|
def step_with_dict(self, **kwargs):
|
||||||
return self.act_model.step(**kwargs)
|
return self.act_model.step(**kwargs)
|
||||||
|
|
||||||
def step(self, obs, M=None, S=None, **kwargs):
|
def step(self, obs, M=None, S=None, **kwargs):
|
||||||
|
@@ -49,7 +49,7 @@ class Runner(AbstractEnvRunner):
|
|||||||
transitions['dones'] = self.dones
|
transitions['dones'] = self.dones
|
||||||
if 'next_states' in prev_transition:
|
if 'next_states' in prev_transition:
|
||||||
transitions['states'] = prev_transition['next_states']
|
transitions['states'] = prev_transition['next_states']
|
||||||
transitions.update(self.model.step_as_dict(**transitions))
|
transitions.update(self.model.step_with_dict(**transitions))
|
||||||
|
|
||||||
# Take actions in env and look the results
|
# Take actions in env and look the results
|
||||||
# Infos contains a ton of useful informations
|
# Infos contains a ton of useful informations
|
||||||
@@ -80,7 +80,7 @@ class Runner(AbstractEnvRunner):
|
|||||||
dtype = data_type[key] if key in data_type else np.float
|
dtype = data_type[key] if key in data_type else np.float
|
||||||
minibatch[key] = np.asarray(minibatch[key], dtype=dtype)
|
minibatch[key] = np.asarray(minibatch[key], dtype=dtype)
|
||||||
|
|
||||||
last_values = self.model.step_as_dict(**transitions)['values']
|
last_values = self.model.step_with_dict(**transitions)['values']
|
||||||
|
|
||||||
# Calculate returns and advantages.
|
# Calculate returns and advantages.
|
||||||
minibatch['advs'], minibatch['returns'] = \
|
minibatch['advs'], minibatch['returns'] = \
|
||||||
|
Reference in New Issue
Block a user