Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. def normal_loss_1 (y_true, y_pred):
  2. y_true_flat = K.flatten(y_true)
  3. y_pred_flat = K.flatten(y_pred)
  4. #d = y_pred_flat * y_true_flat
  5. d = np.dot(y_pred_flat,y_true_flat)
  6. y_sum = K.sum(d)
  7. n_pixels = 256 * 256
  8. normal_output = y_sum/n_pixels
  9. normal_output = tf.reduce_mean(normal_output)
  10. return -normal_output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement