使用,例如 "SoftmaxWithLoss" 图层,你可以添加一个 loss_param { ignore_label: 255 } 告诉caffe忽略这个标签:
"SoftmaxWithLoss"
loss_param { ignore_label: 255 }
layer { name: "loss" type: "SoftmaxWithLoss" bottom: "prediction" bottom: "labels_with_255_as_ignore" loss_weight: 1 loss_param: { ignore_label: 255 } }
我没有检查,但我相信 ignore_label 也用于 InfogainLoss 损失和一些其他损失层。
ignore_label
InfogainLoss