-
Notifications
You must be signed in to change notification settings - Fork 0
/
dcodnn.py
36 lines (30 loc) · 1.12 KB
/
dcodnn.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
30
31
32
33
34
35
36
#imports
from tensorflow.keras.layers import Conv2D, BatchNormalization, Dense, Flatten, Input, MaxPooling2D, Dropout
from tensorflow.keras.models import Model
from odeblocktensorflow import ODEBlock
######################################################
##### large DCODNN network #####
######################################################
def DCODNN(input_shape, num_classes):
x = Input(input_shape)
y = Conv2D(32, (3,3), activation='relu')(x)
y = BatchNormalization(axis=-1)(y)
y = MaxPooling2D(2,2)(y)
y = Dropout(0.3)(y)
y = Conv2D(128, (3,3), activation='relu')(y)
# y = BatchNormalization(axis=-1)(y)
y = Conv2D(128, (3,3), activation='relu')(y)
y = BatchNormalization(axis=-1)(y)
y = MaxPooling2D(2,2)(y)
y = Dropout(0.3)(y)
y = ODEBlock(128, (3,3))(y)
y = BatchNormalization(axis=-1)(y)
y = MaxPooling2D(2,2)(y)
y = Dropout(0.2)(y)
y = Flatten()(y)
y = Dense(512, activation='relu')(y)
y = Dense(256, activation='sigmoid')(y)
y = Dropout(0.1)(y)
y = Dense(num_classes, activation='softmax')(y)
return Model(x,y)
######################################################