pixelwise_softmax_classifier.py 文件源码

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

项目:chainercv 作者: chainer 项目源码 文件源码
def __call__(self, x, t):
        """Computes the loss value for an image and label pair.

        Args:
            x (~chainer.Variable): A variable with a batch of images.
            t (~chainer.Variable): A variable with the ground truth
                image-wise label.

        Returns:
            ~chainer.Variable: Loss value.

        """
        self.y = self.predictor(x)
        self.loss = F.softmax_cross_entropy(
            self.y, t, class_weight=self.class_weight,
            ignore_label=self.ignore_label)

        reporter.report({'loss': self.loss}, self)
        return self.loss
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号