浏览代码

add rpc

/test-recurrent-gail
Andrew Cohen 4 年前
当前提交
ba050418
共有 1 个文件被更改,包括 13 次插入2 次删除
  1. 15
      ml-agents-envs/mlagents_envs/rpc_utils.py

15
ml-agents-envs/mlagents_envs/rpc_utils.py


action_mask = np.split(action_mask, indices, axis=1)
return BatchedStepResult(obs_list, rewards, done, max_step, agent_id, action_mask)
def proto_from_batched_step_result(batched_step_result: BatchedStepResult) -> AgentInfoProto:
def proto_from_batched_step_result(
batched_step_result: BatchedStepResult
) -> AgentInfoProto:
reward = batched_step_result.reward
done = batched_step_result.done
max_step_reached = batched_step_result.max_step

return AgentInfoProto(reward=reward, done=done, id=agent_id, max_step_reached=max_step_reached, action_mask=action_mask, observations=observations)
return AgentInfoProto(
reward=reward,
done=done,
id=agent_id,
max_step_reached=max_step_reached,
action_mask=action_mask,
observations=observations,
)
def _generate_split_indices(dims):
if len(dims) <= 1:

正在加载...
取消
保存