Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit 12727ee

Browse files
use supper classifier
1 parent 048fa07 commit 12727ee

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

zoo/mobilenet/mobilenet_v2_c.py

+1-23
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515

1616
# MobileNet v2 + composable (2019)
17+
# Trainable params: 3,504,872
1718
# Paper: https://arxiv.org/pdf/1801.04381.pdf
1819
# 224x224 input: 3,504,872 parameters
1920

@@ -202,28 +203,5 @@ def inverted_block(x, strides=(1, 1), **metaparameters):
202203
x = Add()([shortcut, x])
203204
return x
204205

205-
def classifier(self, x, n_classes):
206-
""" Construct the classifier group
207-
x : input to the classifier
208-
n_classes : number of output classes
209-
"""
210-
# Save encoding layer
211-
self.encoding = x
212-
213-
# Flatten the feature maps into 1D feature maps (?, N)
214-
x = GlobalAveragePooling2D()(x)
215-
216-
# Save embedding layer
217-
self.embedding = x
218-
219-
# Dense layer for final classification
220-
x = self.Dense(x, n_classes)
221-
# Save pre-activation probabilities layer
222-
self.probabilities = x
223-
outputs = Activation('softmax')(x)
224-
# Save post-activation probabilities layer
225-
self.softmax = outputs
226-
return outputs
227-
228206
# Example
229207
# mobilenet = MobileNetV2()

0 commit comments

Comments
 (0)