| 6 | |
| 7 | class Discriminator(nn.Module): |
| 8 | def __init__(self): |
| 9 | super(Discriminator, self).__init__() |
| 10 | self.conv1 = nn.Conv2d(4, 32, 4, 2, 1, bias=False) |
| 11 | self.bn1 = nn.BatchNorm2d(32) |
| 12 | self.leakyrelu1 = nn.LeakyReLU(0.2, inplace=True) |
| 13 | |
| 14 | self.conv2 = nn.Conv2d(32, 32, 4, 2, 1, bias=False) |
| 15 | self.bn2 = nn.BatchNorm2d(32) |
| 16 | self.leakyrelu2 = nn.LeakyReLU(0.2, inplace=True) |
| 17 | |
| 18 | self.conv3 = nn.Conv2d(32, 32, 4, 2, 1, bias=False) |
| 19 | self.bn3 = nn.BatchNorm2d(32) |
| 20 | self.leakyrelu3 = nn.LeakyReLU(0.2, inplace=True) |
| 21 | |
| 22 | self.fc = nn.Linear(8192, 1) |
| 23 | self.sigmoid = nn.Sigmoid() |
| 24 | |
| 25 | def forward(self, x): |
| 26 | x = x.permute(0, 3, 1, 2) |