Skip to content

Instantly share code, notes, and snippets.

@ericjang
Last active February 24, 2016 16:29
Show Gist options
  • Save ericjang/8dbcf722f429bb0112c4 to your computer and use it in GitHub Desktop.
Save ericjang/8dbcf722f429bb0112c4 to your computer and use it in GitHub Desktop.
# encoder
from tensorflow.models.rnn.rnn_cell import LSTMCell
read_size = 2*read_n*read_n if FLAGS.read_attn else 2*img_size
lstm_enc = LSTMCell(enc_size, read_size+dec_size) # encoder Op
def encode(state,input):
with tf.variable_scope("encoder",reuse=DO_SHARE):
return lstm_enc(input,state)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment