-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
type: maintenanceImprovement of code or keeping the code up to dateImprovement of code or keeping the code up to date
Description
The ´self_tanimoto_similarity´ function equates matrix_a to itself, and then it calls the tanimoto_similarity_sparse
. Calculating norm_2 is repeated in this case which is unnecessarily costly for large arrays. See
MolPipeline/molpipeline/utils/kernel.py
Line 29 in 8190785
norm_2 = np.array(matrix_b.multiply(matrix_b).sum(axis=1)) |
We can add a simple check for identity of the two matrices to avoid redundant computation.
Thanks to Afnan for bringing this to our attention!
Metadata
Metadata
Assignees
Labels
type: maintenanceImprovement of code or keeping the code up to dateImprovement of code or keeping the code up to date