MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / Discriminator

Class Discriminator

GANCode/dModel.py:14–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#判别器对log(1 - D(G(z)))的判别作为生成器的损失值
13
14class Discriminator(torch.nn.Module):
15 def __init__(self):
16 super(Discriminator, self).__init__()
17 self.fc = torch.nn.Sequential(
18 torch.nn.Linear(in_features=784,out_features=512),
19 torch.nn.LeakyReLU(),
20 torch.nn.Linear(in_features=512,out_features=256),
21 torch.nn.LeakyReLU(),
22 torch.nn.Linear(in_features=256,out_features=1),
23 torch.nn.Sigmoid()
24 )
25 def forward(self,input):
26 x = input.view(-1,784)
27 x = self.fc(x)
28 return x

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected