Skip to content

Instantly share code, notes, and snippets.

@chricke
Created March 26, 2019 09:39
Show Gist options
  • Save chricke/be7843e8945e56a0e0e4d68d978d88cf to your computer and use it in GitHub Desktop.
Save chricke/be7843e8945e56a0e0e4d68d978d88cf to your computer and use it in GitHub Desktop.
Create an RNN Cell and initialize it
def get_init_cell(batch_size, rnn_size):
lstm = tf.contrib.rnn.GRUCell(rnn_size)
cell = tf.contrib.rnn.MultiRNNCell([lstm])
initial_state = tf.identity(cell.zero_state(batch_size, tf.float32), name='initial_state')
return cell, initial_state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment