0
$\begingroup$

The shapes of

  • x_train=(514, 256), y_train=(514,)
  • x_test=(254, 256), y_test=(254,)

I have 256 features and 770 samples of which 514 is training and 254 is testing.

I just want to fit a basic sequential model but having difficulty in defining the input shape.

Any help on this please

model1=Sequential()
### first layer
model1.add(Dense(100,input_shape=(256,)))
model1.add(Activation('relu'))
model1.add(Dropout(0.5))
### second layer
model1.add(Dense(200))
model1.add(Activation('relu'))
model1.add(Dropout(0.5))
### third layer
model1.add(Dense(100))
model1.add(Activation('relu'))
model1.add(Dropout(0.5))

### final layer
model1.add(Dense(4))
model1.add(Activation('softmax'))
```
$\endgroup$
1
  • 1
    $\begingroup$ Hi Srikanth, welcome to datascience stackexchange. Can you be more specific as to what error you're seeing, and when, as well as what problem you're trying to solve? Your code is syntactically correct, but it's not clear what you think it should do. Also, your title mentions CNN, but your model code is strictly using dense fully connected layers. $\endgroup$ Commented Aug 3, 2023 at 15:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.