【发布时间】:2019-08-26 14:09:07
【问题描述】:
解析时出现意外的 EOF。我想不通。
outputs = []
for i in range (batch_size):
batch_state = np.zeros([1, hidden_layer], dtype=np.float32)
batch_output = np.zeros([1, hidden_layer], dtype=np.float32)
for ii in range (window_size):
batch_state, batch_output = LSTM_cell(tf.reshape(inputs[i]
[ii], (-1, 1)), batch_state, batch_output)
outputs.append(tf.matmul(batch_output, weights_output + bias_output_layer)
【问题讨论】:
-
确保意图正确。我认为第一个
for不应该缩进。 -
错误是因为括号不匹配。
-
任何体面的 IDE 都应该可以帮助您避免此类问题。
-
谢谢@Barmar,你是对的。
标签: python neural-network lstm