Skip to content

Instantly share code, notes, and snippets.

@Laurans
Created September 2, 2017 18:12
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 Laurans/4c05a12ad0cef23fbdc22b87da1e3d4d to your computer and use it in GitHub Desktop.
Save Laurans/4c05a12ad0cef23fbdc22b87da1e3d4d to your computer and use it in GitHub Desktop.
# -------------- GRAPH --------------
# Placeholder
x = tf.placeholder(tf.float32, [None, d_in])
labels = tf.placeholder(dtype=tf.float32, shape=[None, d_out])
# Learnable parameters
W = tf.Variable(tf.random_normal([d_in,d_out*pool_size]))
b = tf.Variable(tf.zeros([d_out*pool_size]))
# Computation
z = tf.matmul(x, W) + b
h = tf.reduce_max(tf.reshape(z, [-1,d_in,d_out,pool_size]), axis=3)
h = tf.reshape(h, [-1,1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment