net.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:chainer-examples 作者: nocotan 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号