def firstInput(self,t,x=None):
if x is None:
x=Tensor.context
_x = x.content
_t = t.content
_y = self.func(_x,mode=1)
loss = chainer.functions.loss.softmax_cross_entropy.softmax_cross_entropy(_y,_t)
self.func.y = _y
self.func.loss = loss
self.accum_loss += loss
self.cur_log_perp += loss.data
return x
评论列表
文章目录