March 2018
Intermediate to advanced
272 pages
7h 53m
English
Now let's compare that to the code that includes pretrained GloVe vectors encoded in a 2D matrix:
sequence_input = Input(shape=(sequence_length,), dtype='int32')embedding_layer = Embedding(input_dim=vocab_size, output_dim=embedding_dim, weights=[embedding_matrix], input_length=sequence_length, trainable=False, name="embedding")(sequence_input)
For the most part, this code looks equivalent. There are two key differences: