浏览代码

Fix indexing issue

/develop/critic-op-lstm-currentmem
Ervin Teng 4 年前
当前提交
64839237
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 5
      ml-agents/mlagents/trainers/optimizer/torch_optimizer.py

5
ml-agents/mlagents/trainers/optimizer/torch_optimizer.py


init_values, _mem = self.critic.critic_pass(
seq_obs, _mem, sequence_length=self.policy.sequence_length
)
# Trim out padded part
# Trim out padded part, i.e. get last leftover number of elements
signal_name: [init_values[signal_name][leftover:]]
signal_name: [init_values[signal_name][-leftover:]]
for signal_name in init_values.keys()
}

next_value_estimate[k] = 0.0
if agent_id in self.critic_memory_dict:
self.critic_memory_dict.pop(agent_id)
assert len(value_estimates["extrinsic"]) == batch.num_experiences
return value_estimates, next_value_estimate, all_next_memories
正在加载...
取消
保存