Created
June 8, 2020 04:26
-
-
Save eustin/eb3720cf8f6ebbe5219492cede845f65 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
docs_averaged_embeddings = [] | |
for docs_set in docs_embeddings: | |
this_docs_set = [] | |
for doc in docs_set: | |
this_docs_set.append(tf.reduce_mean(doc, axis=0, keepdims=True)) | |
concatenated_docs_set = tf.concat(this_docs_set, axis=0).numpy() | |
docs_averaged_embeddings.append(concatenated_docs_set) | |
docs_averaged_embeddings = np.array(docs_averaged_embeddings) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment