I am a student learning deep learning, and I have some doubts about solving errors. I have a time-series dataset with 10 sensor data. I want to do classification using CNN. I am getting errors while fitting the model.
While debugging I also changed my loss function to ‘sparse_categorical_crossentropy’ but my error was not solved. Kindly help me solve this issue.
n_outputs=5
n_timesteps=10
n_features=1
verbose, epochs, batch_size = 0, 10, 32
model = Sequential()
model.add(Conv1D(filters=64, kernel_size=1, activation=‘relu’, input_shape=(10,1)))
model.add(Conv1D(filters=64, kernel_size=1, activation=‘relu’))
model.add(Dropout(0.5))
model.add(MaxPooling1D(pool_size=2))
model.add(Flatten())
model.add(Dense(100, activation=‘relu’))
model.add(Dense(n_outputs, activation=‘softmax’))
model.summary()
model.compile(loss=‘categorical_crossentropy’, optimizer=‘adam’, metrics=[‘accuracy’])
#fit network
model.fit(trainx, trainy, epochs=epochs, batch_size=batch_size, verbose=verbose)
I have included my code.