def forward(self, activations, targets):
# targets are -1.0 or 1.0, 1-d Variable
# likelihood assigned by the model to pos and neg samples is given by the sigmoid, with the sign
# determined by the class.
# negative log likelihood
return log(sigmoid(activations * targets)).sum() * -1.0
评论列表
文章目录