浏览代码

forcing this to work

/develop/coma-noact
Andrew Cohen 4 年前
当前提交
1511588d
共有 2 个文件被更改,包括 9 次插入10 次删除
  1. 2
      ml-agents/mlagents/trainers/optimizer/torch_optimizer.py
  2. 17
      ml-agents/mlagents/trainers/torch/networks.py

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


if done:
for k in next_value_estimates:
if not self.reward_signals[k].ignore_done:
next_value_estimates[k] = 0.0
next_value_estimates[k] = np.array([0])
return (
value_estimates,

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


self_attn_masks.append(self._get_masks_from_nans(obs))
concat_encoded_obs = []
for inputs in self_obs:
encodes = []
for idx, processor in enumerate(self.processors):
obs_input = inputs[idx]
obs_input[obs_input.isnan()] = 0.0 # Remove NaNs
processed_obs = processor(obs_input)
encodes.append(processed_obs)
concat_encoded_obs.append(torch.cat(encodes, dim=-1))
encodes = []
for idx, processor in enumerate(self.processors):
obs_input = self_obs[idx]
obs_input[obs_input.isnan()] = 0.0 # Remove NaNs
processed_obs = processor(obs_input)
encodes.append(processed_obs)
concat_encoded_obs.append(torch.cat(encodes, dim=-1))
self_attn_masks.append(self._get_masks_from_nans(self_obs))
self_attn_masks.append(self._get_masks_from_nans([self_obs]))
encoding, memories = self.forward(
f_inp,
g_inp,

正在加载...
取消
保存