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

Method __init__

SRGAN/models.py:70–81  ·  view source on GitHub ↗
(self,in_channels = 3, num_channels = 64,num_blocks = 16)

Source from the content-addressed store, hash-verified

68
69class Generator(torch.nn.Module):
70 def __init__(self,in_channels = 3, num_channels = 64,num_blocks = 16):
71 super(Generator, self).__init__()
72 self.initial = ConvBlock(in_channels,num_channels,kernel_size = (9,9),stride = (1,1),padding = (4,4),use_bn=False)
73 self.residuals = torch.nn.Sequential(
74 *[ResidualBlock(num_channels) for _ in range(num_blocks)]
75 )
76 self.convblock = ConvBlock(num_channels,num_channels,kernel_size = (3,3),stride = (1,1),padding = (1,1),use_act=False)
77 self.upsample = torch.nn.Sequential(
78 UpsampleBlock(num_channels,2),
79 UpsampleBlock(num_channels,2)
80 )
81 self.final = torch.nn.Conv2d(num_channels,in_channels,kernel_size=(9,9),stride=(1,1),padding = (4,4))
82
83 def forward(self,x):
84 initial = self.initial(x)

Callers

nothing calls this directly

Calls 4

UpsampleBlockClass · 0.85
ConvBlockClass · 0.70
ResidualBlockClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected