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
pixelwise_softmax_classifier.py 文件源码
python
阅读 164
收藏 0
点赞 0
评论 0
评论列表
文章目录