Last active
March 4, 2018 23:37
-
-
Save eisenjulian/054634b88c66e34a7b7dbb0964a998fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
embedding_matrix = np.random.uniform(-1, 1, size=(vocab_size, embedding_size)) | |
for w, i in word_index.items(): | |
v = embeddings.get(w) | |
if v is not None and i < vocab_size: | |
embedding_matrix[i] = v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment