-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Description
def gdl_loss(y_true, y_pred, alpha=2):
y_true_dy, y_true_dx = tf.image.image_gradients(y_true)
y_pred_dy, y_pred_dx = tf.image.image_gradients(y_pred)
grad_diff_y = tf.abs(tf.abs(y_true_dy) - tf.abs(y_pred_dy))
grad_diff_x = tf.abs(tf.abs(y_true_dx) - tf.abs(y_pred_dx))
loss = tf.reduce_mean(tf.pow(grad_diff_y, alpha) + tf.pow(grad_diff_x, alpha))
return loss
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels