【发布时间】:2019-03-27 05:28:07
【问题描述】:
我想问两个张量是否可以成对相乘。例如,我有来自 LSTM 层的张量输出,
lstm=LSTM(128,return_sequences=True)(input)
output=some_function()(lstm)
some_function() 应该做h1*h2,h2*h3....hn-1*hn
我发现How do I take the squared difference of two Keras tensors? 帮助不大,但是因为我将拥有可训练的参数,所以我将不得不制作自己的图层。此外,some_function 层是否会自动解释输入维度,因为它将是 hn-1
我对如何处理call()感到困惑
【问题讨论】:
标签: python tensorflow machine-learning keras lstm