I am working with EEG data. I want to use the window approach on row signal. My train data size is (1000, 50, 100, 32).
Where,
1000= sample size/ trial number
50= number of the window in each trial
100= sample of time series signal
32= number of channel.
I want to run LSTM on that signal. Please see the sample code
from sklearn.model_selection import train_test_split
import numpy as np
seed = 7
np.random.seed(seed)
X=np.random.rand(1000, 50, 100, 32)
y=np.random.rand(1000)
X_train, X_test, y_train, y_test = train_test_split(X,
y, test_size=0.33, random_state=seed)
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Dropout
model = Sequential()
model.add(LSTM(50, return_sequences=False,
activation='relu',batch_size=5, input_shape=(5,10, 32)))
model.add(Dropout(0.2))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='mae', optimizer='adam')
print(model.summary())
history=model.fit(X_train, y_train, validation_data
(X_test,y_test), epochs=3, batch_size=10)
I can not run the code. Can you please help me?