Created
July 5, 2017 00:59
-
-
Save alexklibisz/f05eafe2426aef6a20149f6c1d64ac92 to your computer and use it in GitHub Desktop.
17softmax
This file contains hidden or 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
inputs = Input((200,200,3)) | |
res = resnet50.ResNet50(include_top=False, weights=None, input_tensor=inputs) | |
# Add a classifier for each class instead of a single classifier. | |
res_out = Flatten()(res.output) | |
res_out = Dropout(0.1)(res_out) | |
classifiers = [] | |
for n in range(17): | |
classifiers.append(Dense(2, activation='softmax')(res_out)) | |
# Concatenate classifiers and reshape to match output shape. | |
x = concatenate(classifiers, axis=-1) | |
labels = x = Reshape((17,1), name='labels')(x) | |
self.net = Model(inputs=res.input, outputs=labels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment