Created
October 3, 2019 21:34
-
-
Save jschwindt/736afa9c0cebcecf510cd9ab1569c40e to your computer and use it in GitHub Desktop.
red
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net_input = Input(shape=(128, 87, 1)) | |
def inception_block(input_layer,filters=64): | |
tower_1 = Conv2D(filters, (1,1), padding='same', activation='relu')(input_layer) | |
tower_1 = Conv2D(filters, (3,3), padding='same', activation='relu')(tower_1) | |
tower_2 = Conv2D(filters, (1,1), padding='same', activation='relu')(input_layer) | |
tower_2 = Conv2D(64, (5,5), padding='same', activation='relu')(tower_2) | |
tower_3 = MaxPooling2D((3,3), strides=(1,1), padding='same')(input_layer) | |
tower_3 = Conv2D(filters, (1,1), padding='same', activation='relu')(tower_3) | |
output = concatenate([tower_1, tower_2, tower_3], axis = 3) | |
return output | |
net=inception_block(net_input,filters=16) | |
net=inception_block(net,filters=16) | |
net=MaxPooling2D((5,5), strides=3)(net) | |
net=Flatten()(net) | |
net=Dense(units=256, activation='relu')(net) | |
net=Dropout(0.1)(net) | |
net=Dense(units=9, activation = 'softmax')(net) | |
model=Model(net_input,net) | |
model.compile(loss='categorical_crossentropy', optimizer='Adam', metrics=['accuracy']) | |
model.summary() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment