首页 > 其他分享 >111111

111111

时间:2023-06-12 11:22:51浏览次数:40  
标签:__ nn self nf 111111 bias gc

def make_layer(block, n_layers):
    layers = []
    for _ in range(n_layers):
        layers.append(block())
    return nn.Sequential(*layers)


class ResidualDenseBlock_5C(nn.Module):
    def __init__(self, nf=64, gc=32, bias=True):
        super(ResidualDenseBlock_5C, self).__init__()
        # gc: growth channel, i.e. intermediate channels
        self.conv1 = nn.Conv2d(nf, gc, 3, 1, 1, bias=bias)
        self.conv2 = nn.Conv2d(nf + gc, gc, 3, 1, 1, bias=bias)
        self.conv3 = nn.Conv2d(nf + 2 * gc, gc, 3, 1, 1, bias=bias)
        self.conv4 = nn.Conv2d(nf + 3 * gc, gc, 3, 1, 1, bias=bias)
        self.conv5 = nn.Conv2d(nf + 4 * gc, nf, 3, 1, 1, bias=bias)
        self.lrelu = nn.LeakyReLU(negative_slope=0.2, inplace=True)

        # initialization
        # mutil.initialize_weights([self.conv1, self.conv2, self.conv3, self.conv4, self.conv5], 0.1)

    def forward(self, x):
        x1 = self.lrelu(self.conv1(x))
        x2 = self.lrelu(self.conv2(torch.cat((x, x1), 1)))
        x3 = self.lrelu(self.conv3(torch.cat((x, x1, x2), 1)))
        x4 = self.lrelu(self.conv4(torch.cat((x, x1, x2, x3), 1)))
        x5 = self.conv5(torch.cat((x, x1, x2, x3, x4), 1))
        return x5 * 0.2 + x


class RRDB(nn.Module):
    '''Residual in Residual Dense Block'''

    def __init__(self, nf, gc=32):
        super(RRDB, self).__init__()
        self.RDB1 = ResidualDenseBlock_5C(nf, gc)
        self.RDB2 = ResidualDenseBlock_5C(nf, gc)
        self.RDB3 = ResidualDenseBlock_5C(nf, gc)

    def forward(self, x):
        out = self.RDB1(x)
        out = self.RDB2(out)
        out = self.RDB3(out)
        return out * 0.2 + x

 

标签:__,nn,self,nf,111111,bias,gc
From: https://www.cnblogs.com/yyhappy/p/17474514.html

相关文章

  • 111111
    ......
  • 11111111111
    importtorchfromtorchimportnnimportnumpyasnpimportmatplotlib.pyplotaspltfromPILimportImagefromtorchvisionimporttransformsfrommathimportsqrtimportosos.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"#读取两张图像img1=I......
  • 111111111
    33MEHOB8W0-eyJsaWNlbnNlSWQiOiIzM01FSE9COFcwIiwibGljZW5zZWVOYW1lIjoiUG9saXRla25payBNZXJsaW1hdSBNZWxha2EiLCJhc3NpZ25lZU5hbWUiOiJtYWdnaWUgc2VyIiwiYXNzaWduZWVFbWF......
  • 111111
    一不小心将注册表中的HKEY_CLASSES_ROOT\.exe删除,导致.exe文件全部打不开。本想重新添加一个值到注册表,却发现就连注册表都打不开。win+R,输入regedit都打不开。还好网上教......
  • 1111111
    1.参考文档见同目录下的.mhtml文件在第一步安装JDK那一步中我选择直接安装了jdk17,因为官网和国内镜像的OpenJDK始终都下载不下来。1.1.配置文件基本信息spring:data......
  • [vue项目] 后台管理 11111111111111111
    文章目录​​gitee地址​​​​登录业务解析​​​​退出登录​​​​模板结构图​​​​路由的搭建​​​​品牌管理​​​​table数据渲染​​​​分页器​​​​点击添加......
  • 111111111111111111
    测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测......
  • 111111
    昨日数据回顾(自己方便记单词,别模仿)布尔值bollTrue,False意思是对的和错的所有的数据自带布尔值布尔值为Flase的有0None''[]{}元组......
  • wireshark 11111111111111111
     wireshark抓包过滤器语法及示例=====================================================================BPF语法(BerkeleyPacketFilter),基于libpcap/wincap库语句......
  • tcpdump 1111111111111111111111111
     tcpdump命令格式、参数====================================================================================================================tcpdump[-AdDe......