February 2019
Beginner to intermediate
308 pages
7h 42m
English
With our input preprocessed, we can now turn our attention to model building. As always, we will use the Sequential class in Keras to build our model. Recall that the Sequential class allows us to stack layers on top of one another, making it really easy to build complex models layer by layer.
As always, let's define a new Sequential class:
from keras.models import Sequentialmodel = Sequential()
We can now add the word embedding layer to our model. The word embedding layer can be constructed directly from the keras.layers as follows:
from keras.layers import Embedding
The Embedding class takes the following important arguments: