updater.py 文件源码

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

项目:Semantic-Segmentation-using-Adversarial-Networks 作者: oyam 项目源码 文件源码
def _get_loss_dis(self):
        batchsize = self.y_fake.data.shape[0]
        loss = F.softmax_cross_entropy(self.y_real, Variable(self.xp.ones(batchsize, dtype=self.xp.int32), volatile=not self.gen.train))
        loss += F.softmax_cross_entropy(self.y_fake, Variable(self.xp.zeros(batchsize, dtype=self.xp.int32), volatile=not self.gen.train))
        chainer.report({'loss': loss}, self.dis)
        return loss
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号