| 60 | |
| 61 | |
| 62 | class up_conv_bn_relu(nn.Module): |
| 63 | def __init__(self,up_size, in_channels, out_channels = 64, kernal_size = 1, padding =0, stride = 1): |
| 64 | super(up_conv_bn_relu,self).__init__() |
| 65 | self.upSample = nn.Upsample(size = (up_size,up_size),mode="bilinear",align_corners=True) |
| 66 | self.conv = nn.Conv2d(in_channels=in_channels,out_channels=out_channels,kernel_size = kernal_size, stride = stride, padding= padding) |
| 67 | self.bn = nn.BatchNorm2d(num_features=out_channels) |
| 68 | self.act = nn.ReLU() |
| 69 | |
| 70 | def forward(self,x): |
| 71 | x = self.upSample(x) |
| 72 | x = self.conv(x) |
| 73 | x = self.bn(x) |
| 74 | x = self.act(x) |
| 75 | return x |
| 76 | |
| 77 | |
| 78 | |