Created
July 16, 2018 18:54
-
-
Save risenW/f66d6b11aedf1f8677bba7731771dd30 to your computer and use it in GitHub Desktop.
Code for Pseudo Huber loss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Plot of the Pseudo-Huber loss | |
delta = tf.constant(0.24) | |
temp_ph = tf.multiply(tf.square(delta),tf.sqrt(1. + tf.square((Y_truth - Y_pred) / delta)) - 1. ) | |
pseudo_h_vals = sess.run(temp_ph) | |
#ploting the predicted values against the L2 loss | |
Y_array = sess.run(Y_pred) | |
plt.plot(Y_array, pseudo_h_vals, 'g-' ) | |
plt.title('Pseudo Huber loss') | |
plt.xlabel('$Y_{pred}$', fontsize=15) | |
plt.ylabel('$Y_{true}$', fontsize=15) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment