def __init__(self, in_ch, out_ch, will_concat=True, layers={}):
self.will_concat = will_concat
channel_expansion = 2 if will_concat else 1
w = chainer.initializers.Normal(0.02)
layers['c0_0'] = CBR(in_ch, 32, bn=False, sample='down', activation=F.leaky_relu, dropout=False)
layers['c0_1'] = CBR(out_ch, 32, bn=False, sample='down', activation=F.leaky_relu, dropout=False)
layers['c1'] = CBR(32 * channel_expansion, 128, bn=True, sample='down', activation=F.leaky_relu, dropout=False)
layers['c2'] = CBR(128, 256, bn=True, sample='down', activation=F.leaky_relu, dropout=False)
layers['c3'] = CBR(256, 512, bn=True, sample='down', activation=F.leaky_relu, dropout=False)
layers['c4'] = L.Convolution2D(512, 1, 3, 1, 1, initialW=w)
super(Discriminator, self).__init__(**layers)
评论列表
文章目录