0
級聯LSTM輸出I有[BATCH_SIZE,1]定義爲這個使用佔位符
cell = tf.contrib.rnn.LSTMCell(num_hidden,state_is_tuple=True)
val, _ = tf.nn.dynamic_rnn(cell, sequential_feed_data, dtype=tf.float32)
val = tf.transpose(val, [1, 0, 2])
last = tf.gather(val, int(val.get_shape()[0]) - 1)
weight_sequential = tf.Variable(tf.truncated_normal([num_hidden,int(target.get_shape()[1])]))
bias_sequential = tf.Variable(tf.constant(0.1, shape=[target.get_shape()[1]]))
output_sequential = tf.nn.softmax(tf.matmul(last, weight_sequential) + bias_sequential)
一個LSTM此output_sequential具有的尺寸。我希望與[BATCH_SIZE,10]維的另一佔位符節點來連接它利用tf.concat得到維度的其他值[BATCH,11]如
combined_data_for_MLP = tf.concat(feed_data, output_sequential, 1)
然而,我得到以下錯誤
TypeError: expected string or bytes-like object
如何根據需要連接?