Skip to content

Instantly share code, notes, and snippets.

@darthdeus
Created January 11, 2019 13:49
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 darthdeus/7e4fe18bbf9efd8e635b3504936298b0 to your computer and use it in GitHub Desktop.
Save darthdeus/7e4fe18bbf9efd8e635b3504936298b0 to your computer and use it in GitHub Desktop.
import tensorflow as tf
tf.reset_default_graph()
input = tf.placeholder(dtype=tf.float32, shape=None)
def encoder(x):
return x*x
def decoder(x):
return x - 3
z = encoder(input)
output = decoder(z)
with tf.Session() as sess:
print(sess.run(output, {input: 3}))
print(sess.run(output, {z: 3}))
print(sess.run([output, z], {input: 3}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment