多标签交叉熵

时间:2015-10-27 13:44:48

标签: machine-learning neural-network multilabel-classification

其中一个答案中有一个交叉熵:nolearn for multi-label classification,即:

# custom loss: multi label cross entropy
def multilabel_objective(predictions, targets):
    epsilon = np.float32(1.0e-6)
    one = np.float32(1.0)
    pred = T.clip(predictions, epsilon, one - epsilon)
    return -T.sum(targets * T.log(pred) + (one - targets) * T.log(one - pred), axis=1)

为什么这个特别是多标签?它看起来很像单变量(单类)分类的对数丢失。我在文献中发现了这一点http://arxiv.org/pdf/1312.5419v3.pdf

0 个答案:

没有答案