- 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')
- 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)