keras functional api embedding layer

Solutions on MaxInterview for keras functional api embedding layer by the best coders in the world

showing results for - "keras functional api embedding layer"
Simona
25 Feb 2016
1max_seq_length=100 #i.e., sentence has a max of 100 words 
2word_weight_matrix = ... #this has a shape of 9825, 300, i.e., the vocabulary has 9825 words and each is a 300 dimension vector 
3deep_inputs = Input(shape=(max_seq_length,))
4embedding = Embedding(9826, 300, input_length=max_seq_length,
5                      weights=[word_weight_matrix], trainable=False)(deep_inputs) # line A
6hidden = Dense(targets, activation="softmax")(embedding)
7model = Model(inputs=deep_inputs, outputs=hidden)
8
similar questions
queries leading to this page
keras functional api embedding layer