浏览代码

Code cleanup

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

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


num_experiences = tensor_obs[0].shape[0]
all_next_memories = AgentBufferField()
# The 1st sequence are the ones that are padded. So if seq_len = 3 and
# trajectory is of length 10, the ist sequence is [pad,pad,obs].
# trajectory is of length 10, the 1st sequence is [pad,pad,obs].
# Compute the number of elements in this padded seq.
leftover = num_experiences % self.policy.sequence_length
first_seq_len = self.policy.sequence_length if leftover == 0 else leftover

正在加载...
取消
保存