Ejemplo n.º 1
0
def conv3d_bn_non(in_planes,
                  out_planes,
                  kernel_size=(3, 3, 3),
                  stride=1,
                  dilation=(1, 1, 1),
                  padding=(1, 1, 1),
                  bias=False):
    return nn.Sequential(
        conv3d_pad(in_planes, out_planes, kernel_size, stride, dilation,
                   padding, bias), SynchronizedBatchNorm3d(out_planes))
Ejemplo n.º 2
0
 def __init__(self,
              channel,
              channel_reduction=4,
              spatial_reduction=4,
              z_reduction=1):
     super(SELayer, self).__init__()
     self.pool_size = (z_reduction, spatial_reduction, spatial_reduction)
     self.se = nn.Sequential(
         nn.AvgPool3d(kernel_size=self.pool_size, stride=self.pool_size),
         nn.Conv3d(channel, channel // channel_reduction, kernel_size=1),
         SynchronizedBatchNorm3d(channel // channel_reduction),
         nn.ELU(inplace=True),
         nn.Conv3d(channel // channel_reduction, channel, kernel_size=1),
         SynchronizedBatchNorm3d(channel),
         nn.Sigmoid(),
         nn.Upsample(scale_factor=self.pool_size,
                     mode='trilinear',
                     align_corners=False),
     )