title: Creating a highly customizable RNN in Tensorflow
body: <p>I am trying to implement an RNN without using the RNN functions provided by tensorflow. Here is the code I tried that eventually gave me an error</p>
  
  <pre><code>import tensorflow as tf
  tf.InteractiveSession()
  x = tf.placeholder(tf.float32, shape=(5,5))
  InitialState = tf.zeros((5,1))
  h = InitialState
  W1 = tf.Variable(tf.random_normal([5, 5], stddev=0.35),
                        name="W1")
  W2 = tf.Variable(tf.random_normal([5, 5], stddev=0.35),
                        name="W2")
  
  for k in range(5):
      h = tf.matmul(W1,h) + tf.matmul(W2,x[:,k:(k+1)])
      h = tf.sigmoid(h)
  with tf.Session() as sess:
      sess.run(tf.initialize_all_variables())
      a = sess.run([h], feed_dict = {x:tf.ones((5,5))})
  </code></pre>
  
  <p>How can I implement an RNN from scratch? Is there an example online?</p>