我写了一些代码,将两个不同尺寸的向量发送到Bi-LSTM中,并连接输出,但出现错误。 这是我的代码:
with tf.variable_scope("bi-lstm"):
cell_bw = LSTMCell(self.hidden_dim)
cell_fw = LSTMCell(self.hidden_dim)
(output_fw_seq_e, output_bw_seq_e), _ = tf.nn.bidirectional_dynamic_rnn(
cell_fw=cell_fw,
cell_bw=cell_bw,
inputs=self.word_embeddings,
sequence_length=self.sequence_lengths,
dtype=tf.float32)
output_e = tf.concat([output_fw_seq_e, output_bw_seq_e], axis=-1)
(output_fw_seq_d, output_bw_seq_d), _ = tf.nn.bidirectional_dynamic_rnn(
cell_fw=cell_fw,
cell_bw=cell_bw,
inputs=self.features_dim,
sequence_length=self.sequence_lengths,
dtype=tf.float32)
output_d = tf.concat([output_fw_seq_d, output_bw_seq_d], axis=-1)
output = tf.concat([output_e, output_d], axis=-1)
output = tf.nn.dropout(output, self.dropout_pl)
self.hidden_dim: 50dim;
self.word_embeddings :100dim;
self.features_dim :3dim;
请帮助