-
Notifications
You must be signed in to change notification settings - Fork 891
Yolo loss binary_crossentropy version #396
Copy link
Copy link
Open
Description
change
TODO: use binary_crossentropy instead
class_loss = obj_mask * sparse_categorical_crossentropy(
true_class_idx, pred_class)
to
true_class_onehot = tf.one_hot(tf.cast(true_class_idx, tf.int64), depth=classes, axis=-1)
true_class_binary = tf.reshape(true_class_onehot, (tf.shape(y_true)[0], grid_size,grid_size,tf.shape(y_true)[3],-1, 1))
pred_class_binary = tf.reshape(pred_class, (tf.shape(y_true)[0], grid_size,grid_size,tf.shape(y_true)[3],-1, 1))
class_loss = obj_mask * tf.reduce_sum(binary_crossentropy(true_class_binary, pred_class_binary), axis=-1)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels