如何从基于LSTM的自动编码器获取潜在空间表示?

时间:2020-10-04 16:40:28

标签: python tensorflow keras lstm autoencoder

我正在尝试从自动编码器中获取潜在空间,以便构建绘图并观察其行为。 我真的不知道是否可以从RepeatVector获得它,还是必须添加一个Dense层。

这是我的代码:

model = Sequential()
input_shape = (X_train.shape[1], X_train.shape[2]) 
model.add(LSTM(16, activation='relu', return_sequences=True, input_shape=input_shape)) #Encoder
model.add(LSTM(4, activation='relu', return_sequences=False)) #Encoder
model.add(RepeatVector(X_train.shape[1])) #Latent
model.add(LSTM(4, activation='relu', return_sequences=True)) #Decoder
model.add(LSTM(16, activation='relu', return_sequences=False)) #Decoder
model.add(TimeDistributed(Dense(X_train.shape[2]))) #Decoder

我如何获得潜在空间表示形式?

0 个答案:

没有答案