3 ms·
These are not bit vectors, but float64. I could probably convert to float32 to cut down the ram. This is a one time job, so no changes. My initial attempt has
by fbdab103 2y ago
These are not bit vectors, but float64. I could probably convert to float32 to cut down the ram. This is a one time job, so no changes.
My initial attempt has been using the scikit-learn cosine similarity function[0] which lets you take a query matrix against a target one. The actual calculation is pretty fast and seems quite optimized (at least, I can see all of my cores max out when it does the calculation). Then I iterate across the results matrix, sorting for best matches, and record best seen to date.
[0] https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.cosine_similarity.html https://scikit-learn.org/stable/modules/generated/sklearn.me...