Changes

Jump to navigation Jump to search
14 bytes removed ,  12:00, 9 May 2019
no edit summary
Then, we applied a tf.while loop through the cell to build our network. The sample code is
def lstm_network(x, weightW, biasb,keep_prob):
'''
define stacked cells and prediction
x: data with shape [batch_size,max_len,len_unique_charlen_unique_tokens]
'''
lstm=lstm_cell(keep_prob)
outputs, states = tf.nn.dynamic_rnn(lstm, x, dtype=tf.float32)
prediction = tf.add(tf.matmul(states.h, weightW), biasb,name='prediction')
return prediction
82

edits

Navigation menu