Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 重塑LSTM的输入数据_Python_Numpy_Tensorflow_Input_Deep Learning - Fatal编程技术网

Python 重塑LSTM的输入数据

Python 重塑LSTM的输入数据,python,numpy,tensorflow,input,deep-learning,Python,Numpy,Tensorflow,Input,Deep Learning,我有1000种配置。每个点有1000个点,在每个点上,观察到6个(最多9个)特征的信息。我希望将最后一列作为目标,表的其余部分将是我的输入训练数据集。现在,为了向LSTM网络提供数据,我遇到了创建输入数据集的初始问题。我不知道如何重塑3D矩阵。我写的主要代码如下: # reshape input to be [samples, time steps, features] trainX = np.reshape(trainX, (trainX.shape[0], 1, trainX.shape[1

我有1000种配置。每个点有1000个点,在每个点上,观察到6个(最多9个)特征的信息。我希望将最后一列作为目标,表的其余部分将是我的输入训练数据集。现在,为了向LSTM网络提供数据,我遇到了创建输入数据集的初始问题。我不知道如何重塑3D矩阵。我写的主要代码如下:

# reshape input to be [samples, time steps, features]
trainX = np.reshape(trainX, (trainX.shape[0], 1, trainX.shape[1]))
testX = np.reshape(testX, (testX.shape[0], 1, testX.shape[1]))

我确信此代码不适合我的问题,但如果您能帮我一个忙,我将不胜感激。

LSTM用于序列数据,您的数据是序列还是时间序列?为什么要使用
LSTM
,以及您需要的数据类型have@MatiasValdenegro我有一系列重复的数据。例如,每年我都有相同点的数据。@ShubhamShaswat,因为我有一个重复的
顺序过程。也许,您会问为什么
LSTM
,为什么不是RNN。我决定使用
LSTM
,因为我知道这一个比
RNN
更适合我的问题,但我不确定(基于搜索)您是否将此时间信息用于LSTM?