| 24 | return self.conv(x) |
| 25 | |
| 26 | class ResidualBlock(torch.nn.Module): |
| 27 | def __init__(self,channels): |
| 28 | super(ResidualBlock, self).__init__() |
| 29 | self.block = torch.nn.Sequential( |
| 30 | ConvBlock(channels,channels,kernel_size = 3,padding = 1), |
| 31 | ConvBlock(channels,channels,use_act=False,kernel_size = 3,padding = 1), |
| 32 | ) |
| 33 | def forward(self,x): |
| 34 | return x + self.block(x) |
| 35 | |
| 36 | class Generator(torch.nn.Module): |
| 37 | def __init__(self,img_channels,num_features = 64,num_residual=9): |