Cómo procesar la forma de entrada y salida para keras LSTM
Estoy aprendiendo sobre RNN y escribí este modelo LSTM simple en keras (theano) usando un conjunto de datos de muestra generado usando sklearn.
from sklearn.datasets import make_regression
from keras.models import Sequential
from keras.layers import Dense,Activation,LSTM
#creating sample dataset
X,Y=make_regression(100,9,9,2)
X.shape
Y.shape
#creating LSTM model
model = Sequential()
model.add(LSTM(32, input_dim=9))
model.add(Dense(2))
model.compile(loss='mean_squared_error', optimizer='adam')
#model fitting
model.fit(X, Y, nb_epoch=1, batch_size=32)
El conjunto de datos de muestra contiene 9 características y 2 objetivos. cuando traté de ajustar mi modelo usando esas características y objetivos me está dando este error
Exception: Error when checking model input: expected lstm_input_9 to have 3 dimensions, but got array with shape (100, 9)