lstm多变量输入回归预测模型_在Keras中使用状态LSTM训练多变量多系列回归问题...

该博客讨论了作者在Keras中使用状态LSTM处理多变量时间序列预测的问题。作者将序列划分为30个时间步长的批次,并尝试预测测试过程的预期寿命。模型架构包括两个LSTM层和一个全连接层。在训练过程中,模型在每个完整序列后重置内部状态。作者遇到的问题是,经过训练后,对同一序列的不同批次预测结果相同,可能是因为过拟合。解决方案可能是对数据进行归一化处理,确保训练和测试集的预处理一致。
摘要由CSDN通过智能技术生成

I have time series of P processes, each of varying length but all having 5 variables (dimensions). I am trying to predict the estimated lifetime of a test process. I am approaching this problem with a stateful LSTM in Keras. But I am not sure if my training process is correct.

I divide each sequence into batches of length 30. So each sequence is of the shape (s_i, 30, 5), where s_i is different for each of the P sequences (s_i = len(P_i)//30). I append all sequences into my training data which has the shape (N, 30, 5) where N = s_1 + s_2 + ... + s_p.

Model:

# design network

model = Sequential()

model.add(LSTM(32, batch_input_shape=(1, train_X[0].shape[1], train_X[0].shape[2]), stateful=True, return_sequences=True))

model.add(LSTM(16, return_sequences=False))

model.add(Dense(1, activation="linear&#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值