Created
July 16, 2018 18:49
-
-
Save risenW/0e2511a751206410268df5a2ec1c926b to your computer and use it in GitHub Desktop.
Code for L2 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
#Calculating the L2 loss | |
val = tf.square(Y_truth - Y_pred) | |
L2_val = sess.run(val) | |
#ploting the predicted values against the L2 loss | |
Y_array = sess.run(Y_pred) | |
plt.plot(Y_array, L2_val, 'b-', label='L2 loss' ) | |
plt.title('L2 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