def loss_func(self, y_true, y_predict):
active_notes = T.shape_padright(y_true[:,:,:,0])
mask = T.concatenate([T.ones_like(active_notes), active_notes, T.repeat(T.ones_like(active_notes), self.output_size-2, -1)], axis=-1)
loglikelihoods = mask * T.log( 2*y_predict*y_true - y_predict - y_true + 1 + self.epsilon )
return T.neg(T.sum(loglikelihoods))
model.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录