合并文本输入的lstm输出和接受数值以传递到关注层的层

时间:2019-12-27 07:52:34

标签: python tensorflow lstm

当前体系结构具有一个关注层,用于接受lstm层的输出。我希望关注层既接受lstm输出,又接受接受数值的另一层的输出。我尝试合并lstm输出和接受数值的图层的输出。

with tf.variable_scope('merged'):
     self.merged = tf.concat((self.rnn_outputs, self.num_output), axis=1)

with tf.variable_scope('attention'):
     self.attn, self.alphas = attention(self.merged)

但是它不起作用。由于lstm具有3 rank(?、单词号,嵌入大小),而接受数字输入的层具有2。关于创建允许同时关注输入文本和数字值的体系结构的任何建议吗?谢谢。

0 个答案:

没有答案