nn.Identity() 影响模型精度
作者: mi-luo创建于 2023年7月13日更新于 2023年7月13日
我尝试添加如下的 Identity 类:
class Iden(nn.Module): def __init__(self, c1, c2): super(Iden, self).__init__() self.conv = nn.Identity() def forward(self, x): x = self.conv(x) return x 理论上,这只是添加了一个占位符,不会影响模型的准确性,但在我们的实验中,这极大地影响了模型的准确性。模型 mAE 分数为 2.14e-05,但在第一个 epoch 中不添加 nn.Identity 时,得到的结果为 0.0095。
内容来源: torch/torch7