January 2018
Intermediate to advanced
310 pages
7h 48m
English
Let's define a CNN from VGG and the LSTM model, using the following code:
vgg_model = tf.keras.applications.vgg16.VGG16(weights='imagenet', include_top=False, input_tensor=input_tensor, input_shape=input_shape)word_embedding = tf.keras.layers.Embedding( vocabulary_size, embedding_dimension, input_length=sequence_length)embbedding = word_embedding(previous_words)embbedding = tf.keras.layers.Activation('relu')(embbedding)embbedding = tf.keras.layers.Dropout(dropout_prob)(embbedding)cnn_features_flattened = tf.keras.layers.Reshape((height * height, shape))(cnn_features)net = tf.keras.layers.GlobalAveragePooling1D()(cnn_features_flattened)net = tf.keras.layers.Dense(embedding_dimension, activation ...
Read now
Unlock full access