Machine learning 压缩序列自动编码器

Machine learning 压缩序列自动编码器,machine-learning,deep-learning,keras,lstm,keras-layer,Machine Learning,Deep Learning,Keras,Lstm,Keras Layer,我想建立一个序列到序列的信号压缩自动编码器。 我想从一个基于std、LSTM的自动编码器开始。然而,凯拉斯抱怨我的模型。有没有暗示我做错了什么 from keras.layers import Input, LSTM, RepeatVector from keras.models import Model timesteps = 10 input_dim = 4 latent_dim = 128 #Create the encoder: inputs = Input(shape=(tim

我想建立一个序列到序列的信号压缩自动编码器。 我想从一个基于std、LSTM的自动编码器开始。然而,凯拉斯抱怨我的模型。有没有暗示我做错了什么

from keras.layers import Input, LSTM, RepeatVector
from keras.models import Model


timesteps = 10
input_dim = 4

latent_dim = 128

#Create the encoder:
inputs = Input(shape=(timesteps, input_dim))
encoded = LSTM(latent_dim)(inputs)
encoder = Model(inputs, encoded)

#Create the decoder:
decInput = Input(shape=(latent_dim))    
decoded = RepeatVector(timesteps)(decInput)
decoded = LSTM(input_dim, return_sequences=True)(decoded)
decoder = Model(decInput,decoded)

#Joining models:
joinedInput = Input(shape=(timesteps, input_dim))
encoderOut = encoder(joinedInput)    
joinedOut = decoder(encoderOut)
sequence_autoencoder = Model(joinedInput,joinedOut)
我在线
encoded=LSTM(潜在尺寸)(输入)

错误

TypeError:应为int32,但得到了包含“\u Message”类型张量的列表


尝试
decInput=Input(shape=(潜伏期,)
给出一条新的错误消息
ValueError:Input 0与层lstm\u 18不兼容:预期ndim=3,发现ndim=2
代码在我这端与Marcin correction一起工作。您的KERA和后端版本是什么?da**it;-)安装的tensor flow不在iPhyton内核中:
print(tf.\uuuuu版本)=0.12.0
print(keras.\uuuuu版本)=2.0.5