def forward(self, input, VGG):
x1 = F.leaky_relu(self.down1(input), 0.2, True)
x2 = F.leaky_relu(self.down2(x1), 0.2, True)
x3 = F.leaky_relu(self.down3(x2), 0.2, True)
x4 = F.leaky_relu(self.down4(x3), 0.2, True)
x5 = F.leaky_relu(self.down5(x4), 0.2, True)
x6 = F.leaky_relu(self.down6(x5), 0.2, True)
x7 = F.leaky_relu(self.down7(x6), 0.2, True)
x8 = F.relu(self.down8(x7), True)
VGG = F.relu(self.linear(VGG), True)
x = F.relu(self.up8(torch.cat([x8, VGG.view(-1, 2048, 1, 1)], 1)), True)
x = F.relu(self.up7(torch.cat([x, x7], 1)), True)
x = F.relu(self.up6(torch.cat([x, x6], 1)), True)
x = F.relu(self.up5(torch.cat([x, x5], 1)), True)
x = F.relu(self.up4(torch.cat([x, x4], 1)), True)
x = F.relu(self.up3(torch.cat([x, x3], 1)), True)
x = F.relu(self.up2(torch.cat([x, x2], 1)), True)
x = F.tanh(self.up1(torch.cat([x, x1], 1)))
return x
############################
# D network
###########################
评论列表
文章目录