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

Commit 9f65e7a

Browse files
use super classifier
1 parent 313262b commit 9f65e7a

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

zoo/xception/xception_c.py

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

1515
# Xception + Composable (2016)
16+
# Trainable params: 22,944,896
1617
# https://arxiv.org/pdf/1610.02357.pdf
1718

1819
import tensorflow as tf
@@ -121,30 +122,7 @@ def exitFlow(x, n_classes, **metaparameters):
121122
""" Create the exit flow section
122123
x : input to the exit flow section
123124
n_classes : number of output classes
124-
"""
125-
def classifier(x, n_classes):
126-
""" The output classifier
127-
x : input to the classifier
128-
n_classes : number of output classes
129-
"""
130-
# Save the encoding layer
131-
Xception.encoding = x
132-
133-
# Global Average Pooling will flatten the 10x10 feature maps into 1D feature maps
134-
x = GlobalAveragePooling2D()(x)
135-
136-
# Save the embedding layer
137-
Xception.embedding = x
138-
139-
# Fully connected output layer (classification)
140-
x = Composable.Dense(x, n_classes, **metaparameters)
141-
# Save the pre-activation layer
142-
Xception.probabilities = x
143-
outputs = Activation('softmax')(x)
144-
# Save the post-activation layer
145-
Xception.softmax = outputs
146-
return outputs
147-
125+
"""
148126
# Remember the input
149127
shortcut = x
150128

@@ -181,7 +159,7 @@ def classifier(x, n_classes):
181159
x = Composable.ReLU(x)
182160

183161
# Create classifier section
184-
x = classifier(x, n_classes)
162+
x = Composable.classifier(x, n_classes, **metaparameters)
185163

186164
return x
187165

0 commit comments

Comments
 (0)