Regularization for LSTM in tensorflow
<p>Tensorflow offers a nice LSTM wrapper.</p>

<pre><code>rnn_cell.BasicLSTM(num_units, forget_bias=1.0, input_size=None,
           state_is_tuple=False, activation=tanh)
</code></pre>

<p>I would like to use regularization, say L2 regularization. However, I don't have direct access to the different weight matrices used in the LSTM cell, so I cannot explicitly do something like</p>

<pre><code>loss = something + beta * tf.reduce_sum(tf.nn.l2_loss(weights))
</code></pre>

<p>Is there a way to access the matrices or use regularization somehow with LSTM?</p>