用于多标签分类的 CNTK 损失和错误度量函数
CNTK Loss and Error Metric function for multi label classification
除了 squared_error 我还可以使用其他什么损失函数/误差函数?
我看了https://cntk.ai/pythondocs/cntk.losses.html
并且找不到任何有帮助的东西。
我找到了大脑脚本的文档,但 python
中没有
任何帮助都会很棒 :)
对于多class class化,我们通常使用cross_entropy_with_softmax.
您正试图将 2 个或更多 class 归因于每个样本,那么 cntk
中没有本机实现
最好的文档来源(恕我直言)python documentation. If you need to write your own loss function I found this 非常有帮助。尝试在输出层使用 sigmoid 函数和二元交叉熵损失或余弦损失。
target = cntk.input_variable(input_dim)
loss = cntk.binary_cross_entropy(z, target)
这样您的节点将输出彼此独立的概率,例如 [0.73, 0.02, 0.05, 0.26, 0.68]。
除了 squared_error 我还可以使用其他什么损失函数/误差函数?
我看了https://cntk.ai/pythondocs/cntk.losses.html 并且找不到任何有帮助的东西。
我找到了大脑脚本的文档,但 python
中没有任何帮助都会很棒 :)
对于多class class化,我们通常使用cross_entropy_with_softmax.
您正试图将 2 个或更多 class 归因于每个样本,那么 cntk
中没有本机实现最好的文档来源(恕我直言)python documentation. If you need to write your own loss function I found this
target = cntk.input_variable(input_dim)
loss = cntk.binary_cross_entropy(z, target)
这样您的节点将输出彼此独立的概率,例如 [0.73, 0.02, 0.05, 0.26, 0.68]。