Skip to content
Snippets Groups Projects
Commit 84b30014 authored by Felix Kleinert's avatar Felix Kleinert
Browse files

update tests for naming of concat layers at the end of each inception block

parent 28e50b5f
Branches
Tags
2 merge requests!59Develop,!48Felix issue059 refac naming of concat layers in inception
Pipeline #30688 passed
...@@ -152,6 +152,10 @@ class TestInceptionModelBase: ...@@ -152,6 +152,10 @@ class TestInceptionModelBase:
assert self.step_in(block_1b._keras_history[0]).name == "Block_1b_5x5" assert self.step_in(block_1b._keras_history[0]).name == "Block_1b_5x5"
assert isinstance(self.step_in(block_pool1._keras_history[0], depth=2), keras.layers.pooling.MaxPooling2D) assert isinstance(self.step_in(block_pool1._keras_history[0], depth=2), keras.layers.pooling.MaxPooling2D)
assert isinstance(self.step_in(block_pool2._keras_history[0], depth=2), keras.layers.pooling.AveragePooling2D) assert isinstance(self.step_in(block_pool2._keras_history[0], depth=2), keras.layers.pooling.AveragePooling2D)
# check naming of concat layer
assert block.name == 'Block_1_Co/concat:0'
assert block._keras_history[0].name == 'Block_1_Co'
assert isinstance(block._keras_history[0], keras.layers.merge.Concatenate)
# next block # next block
opts['input_x'] = block opts['input_x'] = block
opts['tower_pool_parts']['max_pooling'] = True opts['tower_pool_parts']['max_pooling'] = True
...@@ -166,6 +170,10 @@ class TestInceptionModelBase: ...@@ -166,6 +170,10 @@ class TestInceptionModelBase:
assert self.step_in(block_2a._keras_history[0]).name == "Block_2a_3x3" assert self.step_in(block_2a._keras_history[0]).name == "Block_2a_3x3"
assert self.step_in(block_2b._keras_history[0]).name == "Block_2b_5x5" assert self.step_in(block_2b._keras_history[0]).name == "Block_2b_5x5"
assert isinstance(self.step_in(block_pool._keras_history[0], depth=2), keras.layers.pooling.MaxPooling2D) assert isinstance(self.step_in(block_pool._keras_history[0], depth=2), keras.layers.pooling.MaxPooling2D)
# check naming of concat layer
assert block.name == 'Block_2_Co/concat:0'
assert block._keras_history[0].name == 'Block_2_Co'
assert isinstance(block._keras_history[0], keras.layers.merge.Concatenate)
def test_batch_normalisation(self, base, input_x): def test_batch_normalisation(self, base, input_x):
base.part_of_block += 1 base.part_of_block += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment