【发布时间】:2019-01-31 16:06:59
【问题描述】:
我正在设置一个具有多变量时间序列的 LSTM 自动编码器。我的每个序列都有不同的时间步长(一个序列大约有 3000 万步)和 6 个特征。我知道将一个序列作为 LSTM 自动编码器的输入,我必须将我的序列重塑为 (1,30million,6)。我以类似的方式重塑了我所有的 9 个序列。我希望自动编码器重建我的序列。但是,由于每个序列中的大量时间步长,我的程序崩溃了。我该如何解决这个内存错误。即使我以批量大小提供数据,我的程序也会内存不足。我是机器学习和序列学习的新手,所以请帮助我。我的网络附在下面: `
定义重复向量(args):
[layer_to_repeat, sequence_layer] = args
return RepeatVector(K.shape(sequence_layer)[1])(layer_to_repeat)
encoder_input = Input(shape=(None, self._input_features))
encoder_output = LSTM(self._latent_space)(encoder_input)
decoder_input = Lambda(repeat_vector, output_shape=(None, self._latent_space))([encoder_output, encoder_input])
decoder_output = LSTM(self._input_cells, return_sequences=True)(decoder_input)
self._autoencoder = 模型(编码器输入,解码器输出) `
我已经尝试通过 hdf 文件获取输入。
【问题讨论】:
标签: python-3.x keras sequence lstm autoencoder