xq141839 / DCSAU-Net

Elsevier-CIBM-2023: A deeper and more compact split-attention U-Net for medical image segmentation
https://www.sciencedirect.com/science/article/pii/S0010482523000914
Apache License 2.0
72 stars 16 forks source link

pfc backbone 的kernel size #31

Open hz1z opened 1 month ago

hz1z commented 1 month ago

image

class PFC(nn.Module):
    def __init__(self,channels, kernel_size=7):
        super(PFC, self).__init__()
        self.input_layer = nn.Sequential(
                    nn.Conv2d(3, channels, kernel_size, padding=  kernel_size // 2),
                    #nn.Conv2d(3, channels, kernel_size=3, padding= 1),
                    nn.ReLU(inplace=True),
                    nn.BatchNorm2d(channels))
        self.depthwise = nn.Sequential(
                    nn.Conv2d(channels, channels, kernel_size, groups=channels, padding= kernel_size // 2),
                    nn.ReLU(inplace=True),
                    nn.BatchNorm2d(channels))
        self.pointwise = nn.Sequential(
                    nn.Conv2d(channels, channels, kernel_size=1),
                    nn.ReLU(inplace=True),
                    nn.BatchNorm2d(channels))
    def forward(self, x):
        x = self.input_layer(x)
        residual = x
        x = self.depthwise(x)
        x += residual
        x = self.pointwise(x)
        return x

为什么这里第一个input_layer的kernel size是7而不是论文里写的3*3,是我哪里看错了吗