focalloss icon indicating copy to clipboard operation
focalloss copied to clipboard

Focal Loss of multi-classification in tensorflow

Results 5 focalloss issues
Sort by recently updated
recently updated
newest added

看原文应该是,和p_t一样对正负例是不一样的权重

将输入的logits改成predicts, 因为按照惯例"logits"一般是值softmax之前的值, "predicts"才是值进行softmax后得到的概率; 此外还去除了一次冗余的乘法.

假设一个三分类任务, ytruei = tf.Variable([0], dtype=tf.float32) ypred = tf.Variable([[0.5,0.25,0.25]]) ypred2 = tf.Variable([[0.5,0.4,0.1]]) 对于ypred与ypred2来讲两者的loss不应该相同, 把负样本的损失也加上比较好