def forward(self, embeddings_supervised, speeds, is_reverse, steering_wheel, steering_wheel_raw, multiactions_vecs):
def act(x):
return F.leaky_relu(x, negative_slope=0.2, inplace=True)
x_emb_sup = embeddings_supervised # 512x3x5
x_emb_sup = act(self.emb_sup_c1_sd(self.emb_sup_c1_bn(self.emb_sup_c1(x_emb_sup)))) # 1024x1x3
x_emb_sup = x_emb_sup.view(-1, 1024*1*3)
x_emb_sup = add_white_noise(x_emb_sup, 0.005, self.training)
x_emb_add = torch.cat([speeds, is_reverse, steering_wheel, steering_wheel_raw, multiactions_vecs], 1)
x_emb_add = act(self.emb_add_fc1_bn(self.emb_add_fc1(x_emb_add)))
x_emb_add = add_white_noise(x_emb_add, 0.005, self.training)
x_emb = torch.cat([x_emb_sup, x_emb_add], 1)
x_emb = F.dropout(x_emb, p=0.05, training=self.training)
embs = F.relu(self.emb_fc1_bn(self.emb_fc1(x_emb)))
# this is currently always on, to decrease the likelihood of systematic
# errors that are repeated over many frames
embs = add_white_noise(embs, 0.005, True)
return embs
评论列表
文章目录