浏览代码

reuse action dict in torch policy for pre_action

/develop/action-spec-gym
Andrew Cohen 4 年前
当前提交
411b0a19
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 9
      ml-agents/mlagents/trainers/policy/torch_policy.py

9
ml-agents/mlagents/trainers/policy/torch_policy.py


action, log_probs, entropy, memories = self.sample_actions(
vec_obs, vis_obs, masks=masks, memories=memories
)
run_out["action"] = action.to_numpy_dict()
action_dict = action.to_numpy_dict()
run_out["action"] = action_dict
action.to_numpy_dict()["continuous_action"]
if self.use_continuous_act
else None
) # Todo - make pre_action difference
action_dict["continuous_action"] if self.use_continuous_act else None
)
run_out["log_probs"] = log_probs.to_numpy_dict()
run_out["entropy"] = ModelUtils.to_numpy(entropy)
run_out["learning_rate"] = 0.0

正在加载...
取消
保存