Skip to content

Instantly share code, notes, and snippets.

@SuvroBaner
Created December 31, 2019 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SuvroBaner/a3b45c61616fe58b525c520f4739f711 to your computer and use it in GitHub Desktop.
Save SuvroBaner/a3b45c61616fe58b525c520f4739f711 to your computer and use it in GitHub Desktop.
def sigmoid(z):
x = tf.placeholder(tf.float32, name = 'x') # a placeholder tensor (variable)
sigmoid = tf.sigmoid(x) # compting sigmoid function of "x"
with tf.Session() as sess:
result = sess.run(sigmoid, feed_dict = {x : z}) # runnig the computation graph (sigmoid) using a feed_dict
return result
print(sigmoid(1))
print(sigmoid(10))
print(sigmoid(100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment