I would like to build a ANN for text classification, which has an LSTM
layer, and using weights obtained via a Doc2Vec
model trained before:
model_doc2vec = Sequential()
model_doc2vec.add(Embedding(voacabulary_dim, 100, input_length=longest_document, weights=[training_weights], trainable=False))
model_doc2vec.add(LSTM(units=10, dropout=0.25, recurrent_dropout=0.25, return_sequences=True))
model_doc2vec.add(Flatten())
model_doc2vec.add(Dense(3, activation='softmax'))
model_doc2vec.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
At the moment I am not able to get the weights
in the Embedding()
layer mentioned above. I would like to know which is the easiest way to get these weights.