def __call__(self, x, t, label):
y = self.predictor(x, label)
dims = self.xp.prod(np.array(y.shape[2:])) # for CIFAR should be 3072
nll = F.softmax_cross_entropy(y, t, normalize=True)
chainer.report({'nll': nll, 'bits/dim': nll / dims}, self)
return nll
评论列表
文章目录