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

Method __init__

github/net/Generator.py:14–35  ·  view source on GitHub ↗
(self,channels_noise,channels_img,features_g)

Source from the content-addressed store, hash-verified

12
13class Generator(torch.nn.Module):
14 def __init__(self,channels_noise,channels_img,features_g):
15 super(Generator, self).__init__()
16 self.gen = torch.nn.Sequential(
17 #imgsize: 4 x 4
18 self._block(in_channels = channels_noise,out_channels = features_g * 16,kernel_size = (4,4),
19 stride=(1,1),padding=0),
20 # imgsize: 8 x 8
21 self._block(in_channels=features_g * 16, out_channels=features_g * 8, kernel_size=(4, 4), stride=(2,2),
22 padding=1),
23 # imgsize: 16 x 16
24 self._block(in_channels=features_g * 8, out_channels=features_g * 4, kernel_size=(4, 4), stride=(2,2),
25 padding=1),
26 # imgsize: 32 x 32
27 self._block(in_channels=features_g * 4, out_channels=features_g * 2, kernel_size=(4, 4), stride=(2,2),
28 padding=1),
29 # imgsize: N x 3 x 64 x 64
30 torch.nn.ConvTranspose2d(
31 in_channels=features_g * 2, out_channels=channels_img, kernel_size=(4,4), stride=(2,2),
32 padding=(1,1)
33 ),
34 torch.nn.Tanh()
35 )
36
37 def _block(self,in_channels,out_channels,kernel_size,stride,padding):
38 self.conv = torch.nn.Sequential(

Callers

nothing calls this directly

Calls 1

_blockMethod · 0.95

Tested by

no test coverage detected