def entropy(self): with chainer.force_backprop_mode(): return - F.sum(self.all_prob * self.all_log_prob, axis=1)