0
votes

I have written the following

 from keras.layers import InputLayer, Conv1D, Dense, Flatten, MaxPooling1D
 from keras.models import Sequential

 model = Sequential()
 model.add(InputLayer(input_shape=data_x.shape[1:]))
 model.add(Conv1D(filters = 50, kernel_size = 10, activation ='relu'))
 model.add(MaxPooling1D(strides=8))
 model.add(Conv1D(filters=50, kernel_size=10, activation= 'relu' ))
 model.add(MaxPooling1D(strides=8))
 model.add(Flatten())
 model.add(Dense(units=1, activation='softmax'))

But following error is showing.

TypeError Traceback (most recent call last) in () ----> 1 model.add(Conv1D(filters = 50, kernel_size = 10, activation ='relu'))

TypeError: init() takes at least 3 arguments (2 given)

1

1 Answers

0
votes

The problem is with your InputLayer. You need to provide a tuple of integers

(length, number_of_channels).

What is the shape of data_x?

If it only has one channel, try model.add(InputLayer(input_shape=(data_x.shape[1], 1)))

By the way, what is your expected output? If it is binary, you should use activation='sigmoid' instead of activation='softmax'.