(self,in_channels = 3, num_channels = 64,num_blocks = 16)
| 68 | |
| 69 | class 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) |
nothing calls this directly
no test coverage detected