title: Tied weights in tensorflow recurrent cell
body: <p>In the context of an fully-connected autoencoder <a href="https://pdfs.semanticscholar.org/b224/58b7194458bb8c8a3af4f1d8e8aa4c5b34cb.pdf" rel="nofollow noreferrer">this paper</a> states that one type of regularization is to use tied weights for weight matrixes (section 2in the paper). In the paper the weight matrix for the decoder is the transposed of the encoding matrix of the encoder. A pseudo-python writing of this in tensorflow can be:</p>
  
  <pre><code> import tensorflow as tf
   encoder_activation = tf.add(tf.matmul(input_data, W_encoder),self.b_encoder)
   encoder = tf.tanh(activation)
   decoder_activation = tf.add(tf.matmul(encoder, tf.transpose(W_encoder)),self.b_decoder)
   decoder = tf.tanh(decoder_activation)
  </code></pre>
  
  <p>Where input_data is a placeholder and b_* are biases and W_encoder the tied weight matrix of the encoder. Shapes are given so that no dimensionality problems arises.  </p>
  
  <p>My question would be how would I use tied-weight matrix with Tensorflow recurrent cells instead of fully-connected (making it a recursive autoencoder) ? If possible a pseudo python/code hint of the main idea is verry appreciated. I'm not too familiar with the inner workings of the rnn cell. Consider the most basic cell that make illustration of this more easy<br>
  Thank-you</p>