Skip to main content
Formatting
Source Link
n1k31t4
  • 15.1k
  • 2
  • 31
  • 51

I am trying to build a RNN in Keras. I am inputting an array of 300K values. I have 4 independent variables (W,X,Y,Z)(W,X,Y,Z) And 1 dependent variable f(W,X,Y,Z)f(W,X,Y,Z).

The array is then split 270K for training and 30K for validation.

When I try to put my data into the network, it says "expected ndim=3, found ndim=4""expected ndim=3, found ndim=4".

My model looks like this

model=Sequential() model.add(LSTM(4, input_shape=(270000,4))) model.add(Dense(1)) model.compile(loss='mean_squared_error', optimizer ='adam') model.fit(X_tr,Y_tr, validation_data=(X_val, Y_val), epochs=10, batch_size=30000, verbose=1)

model=Sequential()
model.add(LSTM(4, input_shape=(270000,4)))
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer ='adam')
model.fit(X_tr,Y_tr, validation_data=(X_val, Y_val),
          epochs=10, batch_size=30000, verbose=1)

I am trying to build a RNN in Keras. I am inputting an array of 300K values. I have 4 independent variables (W,X,Y,Z) And 1 dependent variable f(W,X,Y,Z).

The array is then split 270K for training and 30K for validation.

When I try to put my data into the network, it says "expected ndim=3, found ndim=4".

My model looks like this

model=Sequential() model.add(LSTM(4, input_shape=(270000,4))) model.add(Dense(1)) model.compile(loss='mean_squared_error', optimizer ='adam') model.fit(X_tr,Y_tr, validation_data=(X_val, Y_val), epochs=10, batch_size=30000, verbose=1)

I am trying to build a RNN in Keras. I am inputting an array of 300K values. I have 4 independent variables (W,X,Y,Z) And 1 dependent variable f(W,X,Y,Z).

The array is then split 270K for training and 30K for validation.

When I try to put my data into the network, it says "expected ndim=3, found ndim=4".

My model looks like this

model=Sequential()
model.add(LSTM(4, input_shape=(270000,4)))
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer ='adam')
model.fit(X_tr,Y_tr, validation_data=(X_val, Y_val),
          epochs=10, batch_size=30000, verbose=1)
Source Link

Keras LSTM Dimensions

I am trying to build a RNN in Keras. I am inputting an array of 300K values. I have 4 independent variables (W,X,Y,Z) And 1 dependent variable f(W,X,Y,Z).

The array is then split 270K for training and 30K for validation.

When I try to put my data into the network, it says "expected ndim=3, found ndim=4".

My model looks like this

model=Sequential() model.add(LSTM(4, input_shape=(270000,4))) model.add(Dense(1)) model.compile(loss='mean_squared_error', optimizer ='adam') model.fit(X_tr,Y_tr, validation_data=(X_val, Y_val), epochs=10, batch_size=30000, verbose=1)