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

Class CNNBlock

pix2pix/net/Discriminator.py:11–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9from torchinfo import summary
10
11class CNNBlock(torch.nn.Module):
12 def __init__(self,in_channels,out_channels,stride=2):
13 super(CNNBlock, self).__init__()
14 self.conv = torch.nn.Sequential(
15 torch.nn.Conv2d(in_channels=in_channels,out_channels=out_channels,kernel_size=(4,4),
16 stride=(stride,stride ),bias=False,padding_mode='reflect'),
17 torch.nn.BatchNorm2d(num_features=out_channels),
18 torch.nn.LeakyReLU(negative_slope=0.2)
19 )
20 def forward(self,input):
21 x = self.conv(input)
22 return x
23
24
25class Discriminator(torch.nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected