Open ztfmars opened 4 years ago
origin: *confidence_loss = object_mask K.binary_crossentropy(object_mask, raw_pred[...,4:5], from_logits=True)+ (1-object_mask) K.binary_crossentropy(object_mask, raw_pred[...,4:5], from_logits=True) ignore_mask**
i think , it means the different cross entroypy value of labels = 1 and labels=0. so the equation should be
_1x binary_crossentropy(lable=1, pred) + (1-0)xignore_maskxbinarycrossentropy(label=0, pred)
so the confidence loss may should be like following:
confidence_loss = object_mask K.binary_crossentropy(object_mask, raw_pred[...,4:5], from_logits=True)+ \ (1-object_mask) K.binary_crossentropy((1-object_mask), raw_pred[...,4:5], from_logits=True) * ignore_mask
the second part of the equation is to verify that you don't detect any object when there is not. So when object_mask is equal to 0, raw_pred[] should too. So the equation seems correct.
origin: *confidence_loss = object_mask K.binary_crossentropy(object_mask, raw_pred[...,4:5], from_logits=True)+ (1-object_mask) K.binary_crossentropy(object_mask, raw_pred[...,4:5], from_logits=True) ignore_mask**
i think , it means the different cross entroypy value of labels = 1 and labels=0. so the equation should be
_1x binary_crossentropy(lable=1, pred) + (1-0)xignore_maskxbinarycrossentropy(label=0, pred)
so the confidence loss may should be like following:
confidence_loss = object_mask K.binary_crossentropy(object_mask, raw_pred[...,4:5], from_logits=True)+ \ (1-object_mask) K.binary_crossentropy((1-object_mask), raw_pred[...,4:5], from_logits=True) * ignore_mask