paddle框架复现NAFNet网络结构

paddle复现NAFNet网络结构

import paddle.nn as nn
import paddle.nn.functional as F
#from basicsr.models.archs.local_arch import Local_Base

class LayerNormFunction(paddle.autograd.PyLayer):

    @staticmethod
    def forward(ctx, x, weight, bias, eps):
        ctx.eps = eps
        N, C, H, W = x.shape
        mu = x.mean(1, keepdim=True)
        var = (x - mu).pow(2).mean(1, keepdim=True)
        y = (x - mu) / (var + eps).sqrt()
        ctx.save_for_backward(y, var, weight)
        #y = weight.view(1, C, 1, 1) * y + bias.view(1, C, 1, 1)
        y = paddle.reshape(weight, [1, C, 1, 1]) * y + paddle.reshape(bias, [1, C, 1, 1])
        return y

    @staticmethod
    def backward(ctx, grad_output):
        eps = ctx.eps
        # N, C, H, W = grad_output.size()
        N, C, H, W = grad_output.shape
        y, var, weight = ctx.saved_tensor()
        g = grad_output * paddle.reshape(weight, [1, C, 1, 1])
        mean_g = g.mean(axis=1, keepdim=True)
        
        mean_gy = (g * y).mean(axis=1, keepdim=True)
        gx = 1. / paddle.sqrt(var + eps) * (g - y * mean_gy - mean_g)
        #return gx, (grad_output * y).sum(axis=3).sum(axis=2).sum(axis=0), grad_output.sum(axis=3).sum(axis=2).sum(axis=0), None
        return gx, (grad_output * y).sum(axis=3).sum(axis=2).sum(axis=0), grad_output.sum(axis=3).sum(axis=2).sum(axis=0)




class LayerNorm2d(nn.Layer):

    def __init__(self, channels, eps=1e-6):
        super(LayerNorm2d, self).__init__()
        self.weight = self.create_parameter(shape=[channels])
        self.add_parameter("weight", self.weight)
        self.bias = self.create_parameter(shape=[channels])
        self.add_parameter("bias", self.bias)
        #self.register_parameter('weight', nn.Parameter(torch.ones(channels)))
        #self.register_parameter('bias', nn.Parameter(torch.zeros(channels)))
        self.eps = eps

    def forward(self, x):
        return LayerNormFunction.apply(x, self.weight, self.bias, self.eps)

class SimpleGate(nn.Layer):
    def forward(self, x):
        x1, x2 = x.chunk(2, axis=1)
        return x1 * x2

class NAFBlock(nn.Layer):
    def __init__(self, c, DW_Expand=2, FFN_Expand=2, drop_out_rate=0.):
        super().__init__()
        dw_channel = c * DW_Expand
        self.conv1 = nn.Conv2D(c, dw_channel, 1, padding=0, stride=1, groups=1, bias_attr=True)
        self.conv2 = nn.Conv2D(dw_channel, dw_channel, 3, padding=1, stride=1, groups=dw_channel,
                               bias_attr=True)
        self.conv3 = nn.Conv2D(dw_channel // 2, c, 1, padding=0, stride=1, groups=1, bias_attr=True)
        
        # Simplified Channel Attention
        self.sca = nn.Sequential(
            nn.AdaptiveAvgPool2D(1),
            nn.Conv2D(in_channels=dw_channel // 2, out_channels=dw_channel // 2, kernel_size=1, padding=0, stride=1,
                      groups=1, bias_attr=True),
        )
        
        # SimpleGate
        self.sg = SimpleGate()

        ffn_channel = FFN_Expand * c
        self.conv4 = nn.Conv2D(c, ffn_channel, 1, padding=0, stride=1, groups=1, bias_attr=True)
        self.conv5 = nn.Conv2D(ffn_channel // 2, c, 1, padding=0, stride=1, groups=1, bias_attr=True)
        self.norm1 = LayerNorm2d(c)
        self.norm2 = LayerNorm2d(c)

        self.dropout1 = nn.Dropout(drop_out_rate) if drop_out_rate > 0. else nn.Identity()
        self.dropout2 = nn.Dropout(drop_out_rate) if drop_out_rate > 0. else nn.Identity()

        # self.beta = nn.Parameter(torch.zeros((1, c, 1, 1)), requires_grad=True)
        # self.gamma = nn.Parameter(torch.zeros((1, c, 1, 1)), requires_grad=True)
        self.beta  = self.create_parameter(shape=[1, c, 1, 1])
        self.add_parameter("beta", self.beta)
        self.gamma = self.create_parameter(shape=[1, c, 1, 1])
        self.add_parameter("gamma", self.gamma)

    def forward(self, inp):
        x = inp

        x = self.norm1(x)

        x = self.conv1(x)
        x = self.conv2(x)
        x = self.sg(x)
        x = x * self.sca(x)
        x = self.conv3(x)

        x = self.dropout1(x)

        y = inp + x * self.beta

        x = self.conv4(self.norm2(y))
        x = self.sg(x)
        x = self.conv5(x)

        x = self.dropout2(x)

        return y + x * self.gamma


class NAFNet(nn.Layer):

    def __init__(self, img_channel=3, width=16, middle_blk_num=1, enc_blk_nums=[], dec_blk_nums=[]):
        super().__init__()
        
        
        self.intro = nn.Conv2D(img_channel,width,3,padding=1,stride=1,groups=1,bias_attr=True)
        self.ending = nn.Conv2D(width,img_channel,3, padding=1, stride=1, groups=1,bias_attr=True)
        self.encoders = nn.LayerList()
        self.decoders = nn.LayerList()
        self.middle_blks = nn.LayerList()
        self.ups = nn.LayerList()
        self.downs = nn.LayerList()

        chan = width
        for num in enc_blk_nums:
            self.encoders.append(
                nn.Sequential(
                    *[NAFBlock(chan) for _ in range(num)]
                )
            )
            self.downs.append(
                nn.Conv2D(chan, 2*chan, 2, 2)
            )
            chan = chan * 2

        self.middle_blks = \
            nn.Sequential(
                *[NAFBlock(chan) for _ in range(middle_blk_num)]
            )

        for num in dec_blk_nums:
            self.ups.append(
                nn.Sequential(
                    nn.Conv2D(chan, chan * 2, 1, bias_attr=False),
                    nn.PixelShuffle(2)
                )
            )
            chan = chan // 2
            self.decoders.append(
                nn.Sequential(
                    *[NAFBlock(chan) for _ in range(num)]
                )
            )

        self.padder_size = 2 ** len(self.encoders)

    def forward(self, inp):
        B, C, H, W = inp.shape
        inp = self.check_image_size(inp)

        x = self.intro(inp)

        encs = []

        for encoder, down in zip(self.encoders, self.downs):
            x = encoder(x)
            encs.append(x)
            x = down(x)

        x = self.middle_blks(x)

        for decoder, up, enc_skip in zip(self.decoders, self.ups, encs[::-1]):
            x = up(x)
            x = x + enc_skip
            x = decoder(x)

        x = self.ending(x)
        x = x + inp

        return x[:, :, :H, :W]

    def check_image_size(self, x):
        _, _, h, w = x.shape
        mod_pad_h = (self.padder_size - h % self.padder_size) % self.padder_size
        mod_pad_w = (self.padder_size - w % self.padder_size) % self.padder_size
        x = F.pad(x, (0, mod_pad_w, 0, mod_pad_h))
        return x

# class NAFNetLocal(Local_Base, NAFNet):
#     def __init__(self, *args, train_size=(1, 3, 256, 256), fast_imp=False, **kwargs):
#         Local_Base.__init__(self)
#         NAFNet.__init__(self, *args, **kwargs)

#         N, C, H, W = train_size
#         base_size = (int(H * 1.5), int(W * 1.5))

#         self.eval()
#         with torch.no_grad():
#             self.convert(base_size=base_size, train_size=train_size, fast_imp=fast_imp)
if __name__ == "__main__":
    img_channel = 3
    width = 32
    enc_blks = [2, 2, 2, 20]
    middle_blk_num = 2
    dec_blks = [2, 2, 2, 2]
    model = NAFNet(img_channel=img_channel, width=width, middle_blk_num=middle_blk_num, 
                        enc_blk_nums=enc_blks, dec_blk_nums=dec_blks)
    paddle.summary(model, (1, 3, 384, 384))

网络结构参数为:

--------------------------------------------------------------------------------
    Layer (type)         Input Shape          Output Shape         Param #    
================================================================================
      Conv2D-1        [[1, 3, 384, 384]]   [1, 32, 384, 384]         896      
   LayerNorm2d-1     [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
      Conv2D-3       [[1, 32, 384, 384]]   [1, 64, 384, 384]        2,112     
      Conv2D-4       [[1, 64, 384, 384]]   [1, 64, 384, 384]         640      
    SimpleGate-1     [[1, 64, 384, 384]]   [1, 32, 384, 384]          0       
AdaptiveAvgPool2D-1  [[1, 32, 384, 384]]     [1, 32, 1, 1]            0       
      Conv2D-6         [[1, 32, 1, 1]]       [1, 32, 1, 1]          1,056     
      Conv2D-5       [[1, 32, 384, 384]]   [1, 32, 384, 384]        1,056     
     Identity-1      [[1, 32, 384, 384]]   [1, 32, 384, 384]          0       
   LayerNorm2d-2     [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
      Conv2D-7       [[1, 32, 384, 384]]   [1, 64, 384, 384]        2,112     
      Conv2D-8       [[1, 32, 384, 384]]   [1, 32, 384, 384]        1,056     
     Identity-2      [[1, 32, 384, 384]]   [1, 32, 384, 384]          0       
     NAFBlock-1      [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
   LayerNorm2d-3     [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
      Conv2D-9       [[1, 32, 384, 384]]   [1, 64, 384, 384]        2,112     
     Conv2D-10       [[1, 64, 384, 384]]   [1, 64, 384, 384]         640      
    SimpleGate-2     [[1, 64, 384, 384]]   [1, 32, 384, 384]          0       
AdaptiveAvgPool2D-2  [[1, 32, 384, 384]]     [1, 32, 1, 1]            0       
     Conv2D-12         [[1, 32, 1, 1]]       [1, 32, 1, 1]          1,056     
     Conv2D-11       [[1, 32, 384, 384]]   [1, 32, 384, 384]        1,056     
     Identity-3      [[1, 32, 384, 384]]   [1, 32, 384, 384]          0       
   LayerNorm2d-4     [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
     Conv2D-13       [[1, 32, 384, 384]]   [1, 64, 384, 384]        2,112     
     Conv2D-14       [[1, 32, 384, 384]]   [1, 32, 384, 384]        1,056     
     Identity-4      [[1, 32, 384, 384]]   [1, 32, 384, 384]          0       
     NAFBlock-2      [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
     Conv2D-15       [[1, 32, 384, 384]]   [1, 64, 192, 192]        8,256     
   LayerNorm2d-5     [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-16       [[1, 64, 192, 192]]   [1, 128, 192, 192]       8,320     
     Conv2D-17       [[1, 128, 192, 192]]  [1, 128, 192, 192]       1,280     
    SimpleGate-3     [[1, 128, 192, 192]]  [1, 64, 192, 192]          0       
AdaptiveAvgPool2D-3  [[1, 64, 192, 192]]     [1, 64, 1, 1]            0       
     Conv2D-19         [[1, 64, 1, 1]]       [1, 64, 1, 1]          4,160     
     Conv2D-18       [[1, 64, 192, 192]]   [1, 64, 192, 192]        4,160     
     Identity-5      [[1, 64, 192, 192]]   [1, 64, 192, 192]          0       
   LayerNorm2d-6     [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-20       [[1, 64, 192, 192]]   [1, 128, 192, 192]       8,320     
     Conv2D-21       [[1, 64, 192, 192]]   [1, 64, 192, 192]        4,160     
     Identity-6      [[1, 64, 192, 192]]   [1, 64, 192, 192]          0       
     NAFBlock-3      [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
   LayerNorm2d-7     [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-22       [[1, 64, 192, 192]]   [1, 128, 192, 192]       8,320     
     Conv2D-23       [[1, 128, 192, 192]]  [1, 128, 192, 192]       1,280     
    SimpleGate-4     [[1, 128, 192, 192]]  [1, 64, 192, 192]          0       
AdaptiveAvgPool2D-4  [[1, 64, 192, 192]]     [1, 64, 1, 1]            0       
     Conv2D-25         [[1, 64, 1, 1]]       [1, 64, 1, 1]          4,160     
     Conv2D-24       [[1, 64, 192, 192]]   [1, 64, 192, 192]        4,160     
     Identity-7      [[1, 64, 192, 192]]   [1, 64, 192, 192]          0       
   LayerNorm2d-8     [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-26       [[1, 64, 192, 192]]   [1, 128, 192, 192]       8,320     
     Conv2D-27       [[1, 64, 192, 192]]   [1, 64, 192, 192]        4,160     
     Identity-8      [[1, 64, 192, 192]]   [1, 64, 192, 192]          0       
     NAFBlock-4      [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-28       [[1, 64, 192, 192]]    [1, 128, 96, 96]       32,896     
   LayerNorm2d-9      [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-29        [[1, 128, 96, 96]]    [1, 256, 96, 96]       33,024     
     Conv2D-30        [[1, 256, 96, 96]]    [1, 256, 96, 96]        2,560     
    SimpleGate-5      [[1, 256, 96, 96]]    [1, 128, 96, 96]          0       
AdaptiveAvgPool2D-5   [[1, 128, 96, 96]]     [1, 128, 1, 1]           0       
     Conv2D-32         [[1, 128, 1, 1]]      [1, 128, 1, 1]        16,512     
     Conv2D-31        [[1, 128, 96, 96]]    [1, 128, 96, 96]       16,512     
     Identity-9       [[1, 128, 96, 96]]    [1, 128, 96, 96]          0       
   LayerNorm2d-10     [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-33        [[1, 128, 96, 96]]    [1, 256, 96, 96]       33,024     
     Conv2D-34        [[1, 128, 96, 96]]    [1, 128, 96, 96]       16,512     
    Identity-10       [[1, 128, 96, 96]]    [1, 128, 96, 96]          0       
     NAFBlock-5       [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
   LayerNorm2d-11     [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-35        [[1, 128, 96, 96]]    [1, 256, 96, 96]       33,024     
     Conv2D-36        [[1, 256, 96, 96]]    [1, 256, 96, 96]        2,560     
    SimpleGate-6      [[1, 256, 96, 96]]    [1, 128, 96, 96]          0       
AdaptiveAvgPool2D-6   [[1, 128, 96, 96]]     [1, 128, 1, 1]           0       
     Conv2D-38         [[1, 128, 1, 1]]      [1, 128, 1, 1]        16,512     
     Conv2D-37        [[1, 128, 96, 96]]    [1, 128, 96, 96]       16,512     
    Identity-11       [[1, 128, 96, 96]]    [1, 128, 96, 96]          0       
   LayerNorm2d-12     [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-39        [[1, 128, 96, 96]]    [1, 256, 96, 96]       33,024     
     Conv2D-40        [[1, 128, 96, 96]]    [1, 128, 96, 96]       16,512     
    Identity-12       [[1, 128, 96, 96]]    [1, 128, 96, 96]          0       
     NAFBlock-6       [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-41        [[1, 128, 96, 96]]    [1, 256, 48, 48]       131,328    
   LayerNorm2d-13     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-42        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-43        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
    SimpleGate-7      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-7   [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-45         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-44        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-13       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-14     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-46        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-47        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-14       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
     NAFBlock-7       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-15     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-48        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-49        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
    SimpleGate-8      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-8   [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-51         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-50        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-15       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-16     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-52        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-53        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-16       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
     NAFBlock-8       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-17     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-54        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-55        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
    SimpleGate-9      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-9   [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-57         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-56        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-17       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-18     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-58        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-59        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-18       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
     NAFBlock-9       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-19     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-60        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-61        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-10      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-10  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-63         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-62        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-19       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-20     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-64        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-65        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-20       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-10       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-21     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-66        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-67        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-11      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-11  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-69         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-68        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-21       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-22     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-70        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-71        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-22       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-11       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-23     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-72        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-73        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-12      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-12  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-75         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-74        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-23       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-24     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-76        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-77        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-24       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-12       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-25     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-78        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-79        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-13      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-13  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-81         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-80        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-25       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-26     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-82        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-83        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-26       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-13       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-27     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-84        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-85        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-14      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-14  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-87         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-86        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-27       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-28     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-88        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-89        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-28       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-14       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-29     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-90        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-91        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-15      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-15  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-93         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-92        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-29       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-30     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-94        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-95        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-30       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-15       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-31     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-96        [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-97        [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-16      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-16  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-99         [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-98        [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-31       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-32     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-100       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-101       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-32       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-16       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-33     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-102       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-103       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-17      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-17  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-105        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-104       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-33       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-34     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-106       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-107       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-34       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-17       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-35     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-108       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-109       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-18      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-18  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-111        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-110       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-35       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-36     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-112       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-113       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-36       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-18       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-37     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-114       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-115       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-19      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-19  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-117        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-116       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-37       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-38     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-118       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-119       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-38       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-19       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-39     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-120       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-121       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-20      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-20  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-123        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-122       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-39       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-40     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-124       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-125       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-40       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-20       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-41     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-126       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-127       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-21      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-21  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-129        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-128       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-41       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-42     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-130       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-131       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-42       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-21       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-43     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-132       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-133       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-22      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-22  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-135        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-134       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-43       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-44     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-136       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-137       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-44       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-22       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-45     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-138       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-139       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-23      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-23  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-141        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-140       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-45       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-46     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-142       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-143       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-46       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-23       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-47     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-144       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-145       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-24      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-24  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-147        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-146       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-47       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-48     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-148       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-149       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-48       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-24       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-49     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-150       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-151       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-25      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-25  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-153        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-152       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-49       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-50     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-154       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-155       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-50       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-25       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-51     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-156       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-157       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-26      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-26  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-159        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-158       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-51       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-52     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-160       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-161       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-52       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-26       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-162       [[1, 256, 48, 48]]    [1, 512, 24, 24]       524,800    
   LayerNorm2d-53     [[1, 512, 24, 24]]    [1, 512, 24, 24]        1,024     
     Conv2D-163       [[1, 512, 24, 24]]   [1, 1024, 24, 24]       525,312    
     Conv2D-164      [[1, 1024, 24, 24]]   [1, 1024, 24, 24]       10,240     
   SimpleGate-27     [[1, 1024, 24, 24]]    [1, 512, 24, 24]          0       
AdaptiveAvgPool2D-27  [[1, 512, 24, 24]]     [1, 512, 1, 1]           0       
     Conv2D-166        [[1, 512, 1, 1]]      [1, 512, 1, 1]        262,656    
     Conv2D-165       [[1, 512, 24, 24]]    [1, 512, 24, 24]       262,656    
    Identity-53       [[1, 512, 24, 24]]    [1, 512, 24, 24]          0       
   LayerNorm2d-54     [[1, 512, 24, 24]]    [1, 512, 24, 24]        1,024     
     Conv2D-167       [[1, 512, 24, 24]]   [1, 1024, 24, 24]       525,312    
     Conv2D-168       [[1, 512, 24, 24]]    [1, 512, 24, 24]       262,656    
    Identity-54       [[1, 512, 24, 24]]    [1, 512, 24, 24]          0       
    NAFBlock-27       [[1, 512, 24, 24]]    [1, 512, 24, 24]        1,024     
   LayerNorm2d-55     [[1, 512, 24, 24]]    [1, 512, 24, 24]        1,024     
     Conv2D-169       [[1, 512, 24, 24]]   [1, 1024, 24, 24]       525,312    
     Conv2D-170      [[1, 1024, 24, 24]]   [1, 1024, 24, 24]       10,240     
   SimpleGate-28     [[1, 1024, 24, 24]]    [1, 512, 24, 24]          0       
AdaptiveAvgPool2D-28  [[1, 512, 24, 24]]     [1, 512, 1, 1]           0       
     Conv2D-172        [[1, 512, 1, 1]]      [1, 512, 1, 1]        262,656    
     Conv2D-171       [[1, 512, 24, 24]]    [1, 512, 24, 24]       262,656    
    Identity-55       [[1, 512, 24, 24]]    [1, 512, 24, 24]          0       
   LayerNorm2d-56     [[1, 512, 24, 24]]    [1, 512, 24, 24]        1,024     
     Conv2D-173       [[1, 512, 24, 24]]   [1, 1024, 24, 24]       525,312    
     Conv2D-174       [[1, 512, 24, 24]]    [1, 512, 24, 24]       262,656    
    Identity-56       [[1, 512, 24, 24]]    [1, 512, 24, 24]          0       
    NAFBlock-28       [[1, 512, 24, 24]]    [1, 512, 24, 24]        1,024     
     Conv2D-175       [[1, 512, 24, 24]]   [1, 1024, 24, 24]       524,288    
   PixelShuffle-1    [[1, 1024, 24, 24]]    [1, 256, 48, 48]          0       
   LayerNorm2d-57     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-176       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-177       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-29      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-29  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-179        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-178       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-57       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-58     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-180       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-181       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-58       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-29       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
   LayerNorm2d-59     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-182       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-183       [[1, 512, 48, 48]]    [1, 512, 48, 48]        5,120     
   SimpleGate-30      [[1, 512, 48, 48]]    [1, 256, 48, 48]          0       
AdaptiveAvgPool2D-30  [[1, 256, 48, 48]]     [1, 256, 1, 1]           0       
     Conv2D-185        [[1, 256, 1, 1]]      [1, 256, 1, 1]        65,792     
     Conv2D-184       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-59       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
   LayerNorm2d-60     [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-186       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,584    
     Conv2D-187       [[1, 256, 48, 48]]    [1, 256, 48, 48]       65,792     
    Identity-60       [[1, 256, 48, 48]]    [1, 256, 48, 48]          0       
    NAFBlock-30       [[1, 256, 48, 48]]    [1, 256, 48, 48]         512      
     Conv2D-188       [[1, 256, 48, 48]]    [1, 512, 48, 48]       131,072    
   PixelShuffle-2     [[1, 512, 48, 48]]    [1, 128, 96, 96]          0       
   LayerNorm2d-61     [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-189       [[1, 128, 96, 96]]    [1, 256, 96, 96]       33,024     
     Conv2D-190       [[1, 256, 96, 96]]    [1, 256, 96, 96]        2,560     
   SimpleGate-31      [[1, 256, 96, 96]]    [1, 128, 96, 96]          0       
AdaptiveAvgPool2D-31  [[1, 128, 96, 96]]     [1, 128, 1, 1]           0       
     Conv2D-192        [[1, 128, 1, 1]]      [1, 128, 1, 1]        16,512     
     Conv2D-191       [[1, 128, 96, 96]]    [1, 128, 96, 96]       16,512     
    Identity-61       [[1, 128, 96, 96]]    [1, 128, 96, 96]          0       
   LayerNorm2d-62     [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-193       [[1, 128, 96, 96]]    [1, 256, 96, 96]       33,024     
     Conv2D-194       [[1, 128, 96, 96]]    [1, 128, 96, 96]       16,512     
    Identity-62       [[1, 128, 96, 96]]    [1, 128, 96, 96]          0       
    NAFBlock-31       [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
   LayerNorm2d-63     [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-195       [[1, 128, 96, 96]]    [1, 256, 96, 96]       33,024     
     Conv2D-196       [[1, 256, 96, 96]]    [1, 256, 96, 96]        2,560     
   SimpleGate-32      [[1, 256, 96, 96]]    [1, 128, 96, 96]          0       
AdaptiveAvgPool2D-32  [[1, 128, 96, 96]]     [1, 128, 1, 1]           0       
     Conv2D-198        [[1, 128, 1, 1]]      [1, 128, 1, 1]        16,512     
     Conv2D-197       [[1, 128, 96, 96]]    [1, 128, 96, 96]       16,512     
    Identity-63       [[1, 128, 96, 96]]    [1, 128, 96, 96]          0       
   LayerNorm2d-64     [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-199       [[1, 128, 96, 96]]    [1, 256, 96, 96]       33,024     
     Conv2D-200       [[1, 128, 96, 96]]    [1, 128, 96, 96]       16,512     
    Identity-64       [[1, 128, 96, 96]]    [1, 128, 96, 96]          0       
    NAFBlock-32       [[1, 128, 96, 96]]    [1, 128, 96, 96]         256      
     Conv2D-201       [[1, 128, 96, 96]]    [1, 256, 96, 96]       32,768     
   PixelShuffle-3     [[1, 256, 96, 96]]   [1, 64, 192, 192]          0       
   LayerNorm2d-65    [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-202      [[1, 64, 192, 192]]   [1, 128, 192, 192]       8,320     
     Conv2D-203      [[1, 128, 192, 192]]  [1, 128, 192, 192]       1,280     
   SimpleGate-33     [[1, 128, 192, 192]]  [1, 64, 192, 192]          0       
AdaptiveAvgPool2D-33 [[1, 64, 192, 192]]     [1, 64, 1, 1]            0       
     Conv2D-205        [[1, 64, 1, 1]]       [1, 64, 1, 1]          4,160     
     Conv2D-204      [[1, 64, 192, 192]]   [1, 64, 192, 192]        4,160     
    Identity-65      [[1, 64, 192, 192]]   [1, 64, 192, 192]          0       
   LayerNorm2d-66    [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-206      [[1, 64, 192, 192]]   [1, 128, 192, 192]       8,320     
     Conv2D-207      [[1, 64, 192, 192]]   [1, 64, 192, 192]        4,160     
    Identity-66      [[1, 64, 192, 192]]   [1, 64, 192, 192]          0       
    NAFBlock-33      [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
   LayerNorm2d-67    [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-208      [[1, 64, 192, 192]]   [1, 128, 192, 192]       8,320     
     Conv2D-209      [[1, 128, 192, 192]]  [1, 128, 192, 192]       1,280     
   SimpleGate-34     [[1, 128, 192, 192]]  [1, 64, 192, 192]          0       
AdaptiveAvgPool2D-34 [[1, 64, 192, 192]]     [1, 64, 1, 1]            0       
     Conv2D-211        [[1, 64, 1, 1]]       [1, 64, 1, 1]          4,160     
     Conv2D-210      [[1, 64, 192, 192]]   [1, 64, 192, 192]        4,160     
    Identity-67      [[1, 64, 192, 192]]   [1, 64, 192, 192]          0       
   LayerNorm2d-68    [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-212      [[1, 64, 192, 192]]   [1, 128, 192, 192]       8,320     
     Conv2D-213      [[1, 64, 192, 192]]   [1, 64, 192, 192]        4,160     
    Identity-68      [[1, 64, 192, 192]]   [1, 64, 192, 192]          0       
    NAFBlock-34      [[1, 64, 192, 192]]   [1, 64, 192, 192]         128      
     Conv2D-214      [[1, 64, 192, 192]]   [1, 128, 192, 192]       8,192     
   PixelShuffle-4    [[1, 128, 192, 192]]  [1, 32, 384, 384]          0       
   LayerNorm2d-69    [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
     Conv2D-215      [[1, 32, 384, 384]]   [1, 64, 384, 384]        2,112     
     Conv2D-216      [[1, 64, 384, 384]]   [1, 64, 384, 384]         640      
   SimpleGate-35     [[1, 64, 384, 384]]   [1, 32, 384, 384]          0       
AdaptiveAvgPool2D-35 [[1, 32, 384, 384]]     [1, 32, 1, 1]            0       
     Conv2D-218        [[1, 32, 1, 1]]       [1, 32, 1, 1]          1,056     
     Conv2D-217      [[1, 32, 384, 384]]   [1, 32, 384, 384]        1,056     
    Identity-69      [[1, 32, 384, 384]]   [1, 32, 384, 384]          0       
   LayerNorm2d-70    [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
     Conv2D-219      [[1, 32, 384, 384]]   [1, 64, 384, 384]        2,112     
     Conv2D-220      [[1, 32, 384, 384]]   [1, 32, 384, 384]        1,056     
    Identity-70      [[1, 32, 384, 384]]   [1, 32, 384, 384]          0       
    NAFBlock-35      [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
   LayerNorm2d-71    [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
     Conv2D-221      [[1, 32, 384, 384]]   [1, 64, 384, 384]        2,112     
     Conv2D-222      [[1, 64, 384, 384]]   [1, 64, 384, 384]         640      
   SimpleGate-36     [[1, 64, 384, 384]]   [1, 32, 384, 384]          0       
AdaptiveAvgPool2D-36 [[1, 32, 384, 384]]     [1, 32, 1, 1]            0       
     Conv2D-224        [[1, 32, 1, 1]]       [1, 32, 1, 1]          1,056     
     Conv2D-223      [[1, 32, 384, 384]]   [1, 32, 384, 384]        1,056     
    Identity-71      [[1, 32, 384, 384]]   [1, 32, 384, 384]          0       
   LayerNorm2d-72    [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
     Conv2D-225      [[1, 32, 384, 384]]   [1, 64, 384, 384]        2,112     
     Conv2D-226      [[1, 32, 384, 384]]   [1, 32, 384, 384]        1,056     
    Identity-72      [[1, 32, 384, 384]]   [1, 32, 384, 384]          0       
    NAFBlock-36      [[1, 32, 384, 384]]   [1, 32, 384, 384]         64       
      Conv2D-2       [[1, 32, 384, 384]]    [1, 3, 384, 384]         867      
================================================================================
Total params: 16,009,251
Trainable params: 16,009,251
Non-trainable params: 0
--------------------------------------------------------------------------------
Input size (MB): 1.69
Forward/backward pass size (MB): 5185.24
Params size (MB): 61.07
Estimated Total Size (MB): 5248.00
--------------------------------------------------------------------------------

纸上得来终觉浅,绝知此事要躬行。

你可能感兴趣的:(图像恢复,u-net变种,paddle,深度学习,cnn)