浏览代码

Fix memory logic in SeparateActorCritic

/develop/add-fire/sac-lst
Ervin Teng 4 年前
当前提交
d51cdf2e
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 10
      ml-agents/mlagents/trainers/torch/networks.py

10
ml-agents/mlagents/trainers/torch/networks.py


memories: Optional[torch.Tensor] = None,
sequence_length: int = 1,
) -> Tuple[Dict[str, torch.Tensor], torch.Tensor]:
actor_mem, critic_mem = None, None
else:
critic_mem = None
# Make memories with the actor mem unchanged
memories_out = torch.cat([actor_mem, critic_mem_out], dim=-1)
if actor_mem is not None:
# Make memories with the actor mem unchanged
memories_out = torch.cat([actor_mem, critic_mem_out], dim=-1)
else:
memories_out = None
return value_outputs, memories_out
def get_dist_and_value(

正在加载...
取消
保存