Created
March 22, 2017 22:49
-
-
Save mrubash1/8fecc2e61125c107f6999a4fa80a45bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with tf.name_scope('lstm'): | |
# Forward direction cell: | |
lstm_fw_cell = tf.contrib.rnn.BasicLSTMCell(n_cell_dim, forget_bias=1.0, state_is_tuple=True) | |
# Backward direction cell: | |
lstm_bw_cell = tf.contrib.rnn.BasicLSTMCell(n_cell_dim, forget_bias=1.0, state_is_tuple=True) | |
# Now we feed `layer_3` into the LSTM BRNN cell and obtain the LSTM BRNN output. | |
outputs, output_states = tf.nn.bidirectional_dynamic_rnn(cell_fw=lstm_fw_cell, | |
cell_bw=lstm_bw_cell, | |
inputs=layer_3, | |
dtype=tf.float32, | |
time_major=True, | |
sequence_length=seq_length) | |
tf.summary.histogram("activations", outputs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment