Skip to content

Instantly share code, notes, and snippets.

@risenW
Created July 16, 2018 18:58
Show Gist options
  • Save risenW/8c56d0f91a481fce515996c51624407f to your computer and use it in GitHub Desktop.
Save risenW/8c56d0f91a481fce515996c51624407f to your computer and use it in GitHub Desktop.
Code for Sigmoid cross entropy loss
x_entropy_sigmoid_vals = tf.nn.sigmoid_cross_entropy_with_logits(labels= Y_labels, logits=Y_pred)
x_entropy_sigmoid_out = sess.run(x_entropy_sigmoid_vals)
#ploting the predicted values against the Sigmoid cross entropy loss
Y_array = sess.run(Y_pred)
plt.plot(Y_array, x_entropy_sigmoid_out, 'y-' )
plt.title('Sigmoid cross entropy loss')
plt.xlabel('$Y_{pred}$', fontsize=15)
plt.ylabel('$Y_{label}$', fontsize=15)
plt.ylim(-2, 5)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment