Skip to content

Commit 71eaa69

Browse files
authored
Update test_application_classifier_activation
1 parent c3dfc34 commit 71eaa69

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

keras/applications/applications_test.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,9 @@ def test_application_pooling(self, app, last_dim):
193193

194194
@parameterized.parameters(MODEL_LIST)
195195
def test_application_classifier_activation(self, app):
196-
last_activation = _get_last_layer_activation(
197-
lambda: app(weights=None, include_top=True, classifier_activation="softmax")
198-
)
199-
self.assertEqual(last_activation, "softmax")
196+
model = app(weights=None, include_top=True, classifier_activation="softmax")
197+
last_layer_act = model.layers[-1].activation.__name__
198+
self.assertEqual(last_layer_act, "softmax")
200199

201200
@parameterized.parameters(*MODEL_LIST_NO_NASNET)
202201
def test_application_variable_input_channels(self, app, last_dim):
@@ -242,11 +241,5 @@ def _get_output_shape(model_fn):
242241
return model.output_shape
243242

244243

245-
def _get_last_layer_activation(model_fn):
246-
model = model_fn()
247-
return model.layers[-1].activation.__name__
248-
249-
250244
if __name__ == "__main__":
251245
tf.test.main()
252-

0 commit comments

Comments
 (0)