Last active
July 17, 2018 11:53
-
-
Save risenW/84029ca0591c41b2bae2bab82bf75b0b to your computer and use it in GitHub Desktop.
Code for L1 norm loss/ Absolute loss function
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
#Computing L1 loss with the same values | |
temp = tf.abs(Y_truth - Y_pred) | |
L1_val = sess.run(temp) | |
#ploting the predicted values against the L2 loss | |
Y_array = sess.run(Y_pred) | |
plt.plot(Y_array, L1_val, 'r-' ) | |
plt.title('L1 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