def log_py(self, y):
xp = self.xp
n_types_of_label = y.data.shape[1]
# prior p(y) expecting that all classes are evenly distributed
constant = math.log(1.0 / n_types_of_label)
log_py = xp.full((y.data.shape[0],), constant, xp.float32)
return self.to_variable(log_py)
评论列表
文章目录