Skip to content

Instantly share code, notes, and snippets.

@sol0invictus
Created March 11, 2020 21:15
Show Gist options
  • Save sol0invictus/168ddbec79ff142687c3136cd934b249 to your computer and use it in GitHub Desktop.
Save sol0invictus/168ddbec79ff142687c3136cd934b249 to your computer and use it in GitHub Desktop.
def sigmoid(z):
# Create a placeholder for x. Name it 'x'.
x = tf.placeholder(tf.float32, name = "x")
# compute sigmoid(x)
sigmoid = tf.sigmoid(x)
# Create a session, and run it. Please use the method 2 explained above.
# You should use a feed_dict to pass z's value to x.
with tf.Session() as sess:
# Run session and call the output "result"
result = sess.run(sigmoid, feed_dict = {x: z})
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment