我正在运行一个LSTM代码,我想使它成为双向LSTM。我该怎么做?
我正在使用来自https://github.com/brunnergino/JamBot.git的代码。名为polyphonic_lstm_training.py的笔记本有代码。
model = Sequential()
model.add(LSTM(lstm_size, batch_size=batch_size, input_shape=(step_size, new_num_notes+chord_dim+counter_size), stateful=True))
model.add(LSTM(lstm_size, batch_input_shape=(batch_size,step_size, new_num_notes+chord_dim+counter_size), stateful=True))我希望它能使用双向LSTM进行训练
发布于 2019-04-05 06:54:26
实现双向LSTM的一种可能方法是在第二LSTM层处理输入之前反转输入。然后,再次反转第二LSTM的输出,并与第一LSTM层的输出连接。
https://stackoverflow.com/questions/55527294
复制相似问题