浏览代码

Add goal to hyper input

/goal-conditioning/new
Arthur Juliani 4 年前
当前提交
21aaa5fe
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 4
      ml-agents/mlagents/trainers/torch/layers.py
  2. 2
      ml-agents/mlagents/trainers/torch/networks.py

4
ml-agents/mlagents/trainers/torch/layers.py


):
super().__init__()
self.layers = []
prev_size = input_size
prev_size = input_size + goal_size
for i in range(num_layers):
if i < num_layers - num_hyper_layers:
self.layers.append(

def forward(
self, input_tensor: torch.Tensor, goal_tensor: torch.Tensor
) -> torch.Tensor:
activation = input_tensor
activation = torch.cat([input_tensor, goal_tensor], dim=-1)
for layer in self.layers:
if isinstance(layer, HyperNetwork):
activation = layer(activation, goal_tensor)

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


encoded_act_size: int = 0,
):
super().__init__()
self.conditioning_mode = ConditioningMode.SOFT
self.conditioning_mode = ConditioningMode.HYPER
self.normalize = network_settings.normalize
self.use_lstm = network_settings.memory is not None
self.h_size = network_settings.hidden_units

正在加载...
取消
保存