def __init__(self, n_hidden=128, bottom_width=4, ch=512, wscale=0.02):
super(Generator, self).__init__()
self.n_hidden = n_hidden
self.ch = ch
self.bottom_width = bottom_width
with self.init_scope():
w = chainer.initializers.Normal(wscale)
self.l0 = L.Linear(self.n_hidden, bottom_width*bottom_width*ch,
initialW=w)
self.dc1 = L.Deconvolution2D(ch, ch//2, 4, 2, 1, initialW=w)
self.dc2 = L.Deconvolution2D(ch//2, ch//4, 4, 2, 1, initialW=w)
self.dc3 = L.Deconvolution2D(ch//4, ch//8, 4, 2, 1, initialW=w)
self.dc4 = L.Deconvolution2D(ch//8, 3, 3, 1, 1, initialW=w)
self.bn0 = L.BatchNormalization(bottom_width*bottom_width*ch)
self.bn1 = L.BatchNormalization(ch//2)
self.bn2 = L.BatchNormalization(ch//4)
self.bn3 = L.BatchNormalization(ch//8)
评论列表
文章目录