charmpeng
charmpeng
我认为,self.lstm_inputs的shape在经过embedding_lookup后,应该是(num_seqs, num_steps, embedding_size)。也就是一个input由embedding_size大小的向量表示。
'with tf.name_scope('lstm'): cell = tf.nn.rnn_cell.MultiRNNCell( [get_a_cell(self.lstm_size, self.keep_prob) for _ in range(self.num_layers)] ) self.initial_state = cell.zero_state(self.num_seqs, tf.float32) # 通过dynamic_rnn对cell展开时间维度 self.lstm_outputs, self.final_state = tf.nn.dynamic_rnn(cell, self.lstm_inputs, initial_state=self.initial_state) print("self.lstm_outputs.get_shape",self.lstm_outputs.get_shape()) # (32,50,128) seq_output = tf.concat(self.lstm_outputs,...
然后在epoch=85,batch size=64的情况下run,7k步时,acc一直都在0.2~0.3间震荡。