qqwweee / keras-yolo3

A Keras implementation of YOLOv3 (Tensorflow backend)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why do you say "K.binary_crossentropy is helpful to avoid exp overflow"?

yiyang186 opened this issue · comments

# K.binary_crossentropy is helpful to avoid exp overflow.

        # K.binary_crossentropy is helpful to avoid exp overflow.
        xy_loss = object_mask * box_loss_scale * K.binary_crossentropy(raw_true_xy, raw_pred[...,0:2], from_logits=True)
        wh_loss = object_mask * box_loss_scale * 0.5 * K.square(raw_true_wh-raw_pred[...,2:4])

You add square loss for wh, I think that is a good job really.
But I don't understand why it also need to add binary_crossentropy loss for xy.
xy = sigmoid(raw_xy)
I think xy con not overflow.