Is the input shape for the LSTM correct considering the problem under analysis?

24 Views Asked by At

I have a dataset with 5000 simulations x 21 time steps x 49 nodes in a total of 5145000 observations. The dataset was created based on finite element simulations. I am trying to use an LSTM to predict the x, y, z coordinates of each node (each node corresponds to an observation).

OUTPUT_SHAPE = 3

model = Sequential()
model.add(LSTM(num_neurons, activation=activation_function, input_shape=(x_train.shape[1], x_train.shape[2])))
model.add(Dense(OUTPUT_SHAPE))

model.compile(
    loss="mean_absolute_error",
    optimizer=tf.keras.optimizers.Adam(learning_rate=learning_rate),
    metrics=["mean_absolute_error"]
)

Here's an example of the dataset for 1 simulation:

time node_position feat3 feat4 feat5 feat6 feat7 feat8 feat9 feat10
0 0 ... ... ... ... ... ... ... ...
0 1 ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ...
0 48 ... ... ... ... ... ... ... ...
-------- -------- -------- -------- -------- -------- -------- -------- -------- --------
... ... ... ... ... ... ... ... ... ...
-------- -------- -------- -------- -------- -------- -------- -------- -------- --------
20 0 ... ... ... ... ... ... ... ...
20 1 ... ... ... ... ... ... ... ...
... ... ... ... ... ... ... ... ... ...
20 48 ... ... ... ... ... ... ... ...

Since I want to predict the coordinates for each observation, the input form for the LSTM is defined as nº samples x 1 x 10 (10 is the number of features). I use 1 as the time step because the only information I have in each simulation is the information for t=0, so I can't use more past observations to predict new ones.

X_train.shape = (1039290, 1, 10)
y_train.shape = (1039290, 3)

The problem is that I don't have a unique time series, I have multiple time series (49 for each simulation corresponding to each node displacement). So is it wrong to consider the input to the LSTM like this?

0

There are 0 best solutions below