First of all,Thank you very much for sharing this code!
I have a question as to why the loss is normalized by the number of positive anchors?
normalizer = backend.where(keras.backend.equal(anchor_state, 1))
I think that the loss should be normalized according to the number of positive and negative anchors, because it is calculated by positive and negative anchors.
normalizer = backend.where(keras.backend.not_equal(anchor_state, -1))
Is this right?
@fizyr
There was a bit of a discussion when this was first implemented, on whether it should be normalized by the number of positive anchors or by the number of positive+negative anchors. The paper is a bit unclear about this, they only mention that they normalize the focal loss by the number of positive anchors.
I believe in the end we chose to use the same normalisation used in the py-faster-rcnn implementation, which uses normalisation by number of positive anchors.
There was a bit of a discussion when this was first implemented, on whether it should be normalized by the number of positive anchors or by the number of positive+negative anchors. The paper is a bit unclear about this, they only mention that they normalize the focal loss by the number of positive anchors.
I believe in the end we chose to use the same normalisation used in the py-faster-rcnn implementation, which uses normalisation by number of positive anchors.
I understand, thank you very much for your answer!!!!!!
Most helpful comment
There was a bit of a discussion when this was first implemented, on whether it should be normalized by the number of positive anchors or by the number of positive+negative anchors. The paper is a bit unclear about this, they only mention that they normalize the focal loss by the number of positive anchors.
I believe in the end we chose to use the same normalisation used in the py-faster-rcnn implementation, which uses normalisation by number of positive anchors.