| 12 | #判别器对log(1 - D(G(z)))的判别作为生成器的损失值 |
| 13 | |
| 14 | class 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 |
nothing calls this directly
no outgoing calls
no test coverage detected