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

Method __init__

github/net/Discriminator.py:14–28  ·  view source on GitHub ↗
(self,channels_img,features_d)

Source from the content-addressed store, hash-verified

12
13class Discriminator(torch.nn.Module):
14 def __init__(self,channels_img,features_d):
15 super(Discriminator, self).__init__()
16 self.disc = torch.nn.Sequential(
17 torch.nn.Conv2d(
18 in_channels=channels_img,out_channels=features_d,kernel_size=(4,4),stride=(2,2),padding=(1,1)
19 ),
20 torch.nn.LeakyReLU(negative_slope=0.2,inplace=True),
21 self._block(in_channels=features_d,out_channels=features_d * 2,kernel_size=(4,4),stride=(2,2),
22 padding=(1,1)),
23 self._block(in_channels=features_d * 2, out_channels=features_d * 4, kernel_size=(4, 4), stride=(2, 2),
24 padding=(1, 1)),
25 self._block(in_channels=features_d * 4, out_channels=features_d * 8, kernel_size=(4, 4), stride=(2, 2),
26 padding=(1, 1)),
27 torch.nn.Conv2d(in_channels=features_d*8,out_channels=1,kernel_size=(4,4),stride=(2,2),padding=0)
28 )
29 def _block(self,in_channels,out_channels,kernel_size,stride,padding):
30 self.conv = torch.nn.Sequential(
31 torch.nn.Conv2d(in_channels=in_channels,out_channels=out_channels,kernel_size=kernel_size,stride=stride,padding=padding,bias=False),

Callers

nothing calls this directly

Calls 1

_blockMethod · 0.95

Tested by

no test coverage detected