Skip to content

Instantly share code, notes, and snippets.

@SubhadityaMukherjee
Created January 21, 2020 16:23
Show Gist options
  • Save SubhadityaMukherjee/ec7f64d577d44de10f9cd5db2f1fcfc1 to your computer and use it in GitHub Desktop.
Save SubhadityaMukherjee/ec7f64d577d44de10f9cd5db2f1fcfc1 to your computer and use it in GitHub Desktop.
model

Pre trained

  • We use Inception Net v3 which is a pretrained network that already has some idea of the world.
  • We use imagenet weights which basically allows us to use transfer learning on the network
  • Instead of training from scratch we can just cherry pick layers and use our neural network on it
base_model = tf.keras.applications.InceptionV3(include_top=False,
                                               weights='imagenet')

Model

  • We now choose two layers mixed3 and mixed5 from the inception pretrained network. The layers list will allow us to use these names and choose them from the model
  • We then create a model with the base model (Inception) as input and the layers as output
names = ['mixed3', 'mixed5']
layers = [base_model.get_layer(name).output for name in names]
dream_model = tf.keras.Model(inputs=base_model.input, outputs=layers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment