Я бы попытался создать модель LSTM с несколькими переменными функциями. У меня есть 5 функций, поэтому у меня есть матрица ввода N x T x D (где T = 10, D = 5) и та же матрица проверки. Форма матрицы должна быть в порядке, данные стандартизированы и т. Д. c, но я получил сообщение об ошибке. Как мне решить эту проблему?
T = 10
D = 5
X = []
Y = []
X2 = []
Y2 = []
for t in range(len(X_train) - T):
x = X_train[t:t+T]
X.append(x)
y = Y_train[t+T]
Y.append(y)
for t in range(len(X_test) - T):
x_test = X_test[t:t+T]
X2.append(x_test)
y_test = Y_test[t+T]
Y2.append(y_test)
np.array(X).shape
X = np.array(X).reshape(-1, T, D) # Now the data should be N x T x D
Y = np.array(Y)
X2 = np.array(X2).reshape(-1, T, D) # Now the data should be N x T x D
Y2 = np.array(Y2)
N = len(X)
print("X.shape", X.shape, "Y.shape", Y.shape)
print("X2.shape", X2.shape, "Y2.shape", Y2.shape)
### try autoregressive RNN model
i = Input(shape=(T, D))
x = LSTM(5)(i)
x = Dense(1)(x)
model = Model(i, x)
model.compile(
loss='mse',
optimizer=Adam(lr=0.1),
)
# train the RNN
r = model.fit(
X, Y,
epochs=80,
validation_data=(X2, Y2),
)
И я получаю это сообщение об ошибке
UnknownError: [_Derived_] Fail to find the dnn implementation.
[[{{node CudnnRNN}}]]
[[model_3/lstm_3/StatefulPartitionedCall]] [Op:__inference_distributed_function_6850]
Function call stack:
distributed_function -> distributed_function -> distributed_function