关于图像去噪的代码,有不理解的地方,求大佬讲解
for _ in range(depth-2):##构建卷积层
layers.append(nn.Conv2d(in_channels=n_channels, out_channels=n_channels, kernel_size=kernel_size, padding=padding, bias=False))
layers.append(nn.BatchNorm2d(n_channels, eps=0.0001, momentum = 0.95))
layers.append(nn.ReLU(inplace=True))
#构建卷积层
layers.append(nn.Conv2d(in_channels=n_channels, out_channels=image_channels, kernel_size=kernel_size, padding=padding, bias=False))
#利用nn.Sequential()按顺序构建网络//Sequential容器,模块将按照构造函数中传递的顺序添加到模块中
self.dncnn = nn.Sequential(*layers)
self._initialize_weights() #调用初始化权重函数
我想知道循环到哪里结束,并且为什么构建了卷积层,又要构建一次卷积层?
代码的意思是什么意思?
方便的话可以加个微信:17714526081