草庐IT

CudnnLSTM

全部标签

python - 与 Tensorflow 中的常规 LSTMCell 相比,使用 CudnnLSTM 训练时的不同结果

我正在使用Python中的Tensorflow训练LSTM网络,并想切换到tf.contrib.cudnn_rnn.CudnnLSTM以加快训练速度。我做的是替换cells=tf.nn.rnn_cell.LSTMCell(self.num_hidden)initial_state=cells.zero_state(self.batch_size,tf.float32)rnn_outputs,_=tf.nn.dynamic_rnn(cells,my_inputs,initial_state=initial_state)与lstm=tf.contrib.cudnn_rnn.CudnnLST