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

Commit 313262b

Browse files
use super classifier
1 parent 12727ee commit 313262b

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

zoo/shufflenet/shufflenet_c.py

+1-23
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
# ShuffleNet v1.0 (composable)
16+
# Trainable params: 1,680,620
1617
# Paper: https://arxiv.org/pdf/1707.01083.pdf
1718

1819
import tensorflow as tf
@@ -278,28 +279,5 @@ def channel_shuffle(x, n_partitions):
278279
x = Lambda(lambda z: K.reshape(z, [-1, height, width, n_filters]))(x)
279280
return x
280281

281-
def classifier(self, x, n_classes):
282-
''' Construct the Classifier Group
283-
x : input to the classifier
284-
n_classes : number of output classes
285-
'''
286-
# Save the encoding layer
287-
self.encoding = x
288-
289-
# Use global average pooling to flatten feature maps to 1D vector, where
290-
# each feature map is a single averaged value (pixel) in flatten vector
291-
x = GlobalAveragePooling2D()(x)
292-
293-
# Save the embedding layer
294-
self.embedding = x
295-
296-
x = self.Dense(x, n_classes)
297-
# Save the pre-activation probabilities
298-
self.probabilities = x
299-
outputs = Activation('softmax')(x)
300-
# Save the post-activation probabilities
301-
self.softmax = outputs
302-
return outputs
303-
304282
# Example
305283
# shufflenet = ShuffleNet()

0 commit comments

Comments
 (0)