How to do it...

We can proceed with the recipe as follows:

  1. Load all the Keras modules needed by the recipe. These include spaCy for word embedding, VGG16 for image features extraction, and LSTM for language modeling. The remaining few additional modules are pretty standard:
%matplotlib inlineimport os, argparseimport numpy as npimport cv2 as cv2import spacy as spacyimport matplotlib.pyplot as pltfrom keras.models import Model, Inputfrom keras.layers.core import Dense, Dropout, Reshapefrom keras.layers.recurrent import LSTMfrom keras.layers.merge import concatenatefrom keras.applications.vgg16 import VGG16from keras.preprocessing import imagefrom keras.applications.vgg16 import preprocess_inputfrom sklearn.externals import joblibimport PIL.Image ...

Get TensorFlow 1.x Deep Learning Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.