将先前时间步长的LSTM层的输出馈送到当前时间步长的密集层的输入(Keras,Tensorflow)

时间:2020-09-08 16:33:05

标签: python tensorflow keras lstm recurrent-neural-network

我正在尝试重新创建图形为无花果的RNN。 K. Yeo等人在this论文中的第8页。

到目前为止,我仅使用了Keras功能API中所述的层:

inputs = keras.Inputs(shape=(,))

Input_Linear_1 = layers.Dense(num_neurons, activation = 'tanh')(inputs)

#merge h_t-1 and Input_Linear_1 -> Merged_Out_InLin1

Input_Linear_2 = layers.Dense(num_neurons, activation = '')(Merged_Out_InLin1)

LSTM_cell = layers.LSTM(num_LSTM_units)(Input_Linear_2)

Out_Linear_1 = layers.Dense(num_neurons, activation = 'tanh')(LSTM_cell)

Out_Linear_2 = layers.Dense(num_neurons, activation = 'softplus')(Out_Linear_1)

Softmax_OUT = layers.Dense(num_neurons, activation = 'softmax')(Out_Linear_2)

困扰我的部分由代码中的注释描述;我想使用上一个时间步的LSTM单元的输出,并将其输入到DE-RNN的第二层。我还没有找到一种整齐的方法来做到这一点。任何帮助将不胜感激。

0 个答案:

没有答案