Skip to content

Instantly share code, notes, and snippets.

@kwakseonghun
Last active August 10, 2017 11:39
Show Gist options
  • Save kwakseonghun/02b1a3779e4b52a4450662e8c1195c31 to your computer and use it in GitHub Desktop.
Save kwakseonghun/02b1a3779e4b52a4450662e8c1195c31 to your computer and use it in GitHub Desktop.
import tensorflow as tf
X = tf.placeholder("float")
init1 = 100
init = 0
step = 10
K = int(init1/step) - 1
W={}
b={}
for i in range(K):
init = init1
init1 -= step
W[i] = tf.Variable(tf.random_normal([init,init1]))
b[i]=tf.Variable(tf.random_normal([init1]))
if i==0:
L=tf.nn.sigmoid(tf.matmul(X,W[0])+b[0])
else:
L=tf.nn.sigmoid(tf.matmul(L,W[i])+b[i])
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for i in range(K):
q = tf.shape(W[i])
print(sess.run(q))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment