class FeatureProcess(nn.Module): def __init__(self, Cin, Cout, channels): super(FeatureProcess, self).__init__() self.conv_p = nn.Conv2d(Cin, channels, 3, 1, 1) self.conv_p1 = nn.Conv2d(Cout, channels, 3, 1, 1) self.block = SpaFre(channels) self.block1 = SpaFre(channels) self.block2 = SpaFre(channels) self.block3 = SpaFre(channels) self.block4 = SpaFre(channels) self.fuse = nn.Conv2d(5*channels,channels,1,1,0) def forward(self, ms, pan): msf = self.conv_p(ms) panf = self.conv_p1(pan) msf0, panf0 = self.block(msf, panf) msf1, panf1 = self.block1(msf0,panf0) msf2, panf2 = self.block2(msf1, panf1) msf3, panf3 = self.block3(msf2, panf2) msf4, panf4 = self.block4(msf3, panf3) msout = self.fuse(torch.cat([msf0,msf1,msf2,msf3,msf4],1)) return msout
时间: 2023-05-11 07:05:44 浏览: 155
这是一个 PyTorch 的神经网络模块,名为 FeatureProcess,它包含了一些卷积层和 SpaFre 模块。它的输入是两个张量 ms 和 pan,分别经过了两个卷积层,然后通过五个 SpaFre 模块进行特征处理,最后将处理后的特征张量拼接起来,再经过一个卷积层输出 msout。
阅读全文