Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# -------------- 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