-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodel.py
29 lines (25 loc) · 904 Bytes
/
model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
model = Sequential()
model.add(Conv2D(32, (3, 3), padding='same', input_shape=X_train[0].shape))
model.add(Activation('relu'))
model.add(Conv2D(32, (3, 3), activation='relu'))
model.add(MaxPooling2D())
model.add(Dropout(0.20))
model.add(Conv2D(32, (3, 3), padding='same'))
#model.add(Activation('relu'))
model.add(Conv2D(128, (3, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D())
#model.add(Dropout(0.10))
model.add(Conv2D(128, (3, 3), padding='same'))
model.add(Activation('relu'))
model.add(BatchNormalization(axis=-1))
model.add(Conv2D(512, (3, 3)))
model.add(Activation('relu'))
model.add(MaxPooling2D())
model.add(Dropout(0.25))
model.add(Flatten())
model.add(Dense(1024))
model.add(Dropout(0.25))
model.add(Dense(activation='softmax', units=2))
model.compile(loss='sparse_categorical_crossentropy', optimizer = opt, metrics=["accuracy"])
model.summary()