sum”,”mul”,”concat”,”ave”,None],默认是“concat”模式,两个LSTM的输出沿channel维度串联。...选择None时,输出不会被结合,作为一个列表返回。...示例2:同时返回各个时刻的输出,与最后一个时刻的状态(注意输出的排序)
import tensorflow as tf
import numpy as np
import keras
from keras.layers...==h2)
可见,在双向LSTM中,如果输出LSTM的最后一个时刻的cell状态, 得到的输出的排序是:lstm_out1, lstm_out2, h1, c1, h2, c2。...其中lstm_out1,h1,c1是前向LSTM的输出,lstm_out2,h2,c2是后向LSTM的输出。