Created
February 16, 2018 15:23
-
-
Save peune/5110d2b693dab5ef3be5f638ca45f8f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_content_mod( base_model, input_shape ): | |
input_c = Input( shape=input_shape ) | |
m4 = Model(inputs=base_model.input, outputs=base_model.get_layer('my_block4_conv2').output) | |
c4 = m4(input_c) | |
c4 = Flatten()(c4) | |
m5 = Model(inputs=base_model.input, outputs=base_model.get_layer('my_block5_conv2').output) | |
c5 = m5(input_c) | |
c5 = Flatten()(c5) | |
output_c = Concatenate()([ c4, c5 ]) | |
m4.trainable = False | |
m5.trainable = False | |
content_mod = Model(inputs=input_c, outputs=output_c) | |
return content_mod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment