August 2018
Intermediate to advanced
438 pages
12h 3m
English
Most of the networks we have built across previous chapters have utilized the sequential API from Keras. Fusion layer is an innovative way to utilize transfer learning in this context. Remember that we have utilized the input grayscale image as input for two different networks, an encoder and a pretrained VGG16. Since the output of both networks is of different shapes, we repeat the output from VGG16 by 1,000 times and concatenate or perform a fusion with the encoder output. The following snippet prepares the fusion layer:
#Fusionfusion_layer_output = RepeatVector(32*32)(emd_input)fusion_layer_output = Reshape(([32,32, 1000]))(fusion_layer_output)fusion_layer_output = concatenate([enc_output, fusion_layer_output], axis=3)fusion_layer_output ...