pytorch的spectral_norm的使用
利用pytorch自带的频谱归一化函数,给设定好的网络进行频谱归一化。主要用于生成对抗网络的鉴别器,效果还是很明显的。import torchimport torch.nn as nn class TestModule(nn.Module): def __init__(self): super(TestModule,self).__init__() self.layer1 = nn.Conv2d(16,32,3,1) self.layer2 =
原创
2021-04-11 11:22:27 ·
10440 阅读 ·
0 评论