ethereal-ai / xlr8 Goto Github PK
View Code? Open in Web Editor NEWFast cosine similarity for Python
License: MIT License
Fast cosine similarity for Python
License: MIT License
@grandmaster-ethereal
I have followed all the steps starting from cloning the repository to editable install and additional installation of sparse_dot_mkl as well as intel mkl as mentioned in the Readme.md file in the GitHub repo.
I was trying this code:
from xlr8.similarity import cosine_similarity
import numpy as np
A = np.random.rand(1000,1000)
B = np.random.rand(1000,1000)
cosine_similarity(A, B, blas="mkl")
And encountered this error:
Traceback (most recent call last):
File "", line 1, in
File "e:\data science\iub projects\gra_foundations and grantees\scripts and notebooks\python scripts\xlr8\similarity.py", line 84, in cosine_similarity
kernel_matrix = sparse_dot_product(
File "e:\data science\iub projects\gra_foundations and grantees\scripts and notebooks\python scripts\xlr8\linalg.py", line 198, in sparse_dot_product
a_b = dot_product(a, b)
File "e:\data science\iub projects\gra_foundations and grantees\scripts and notebooks\python scripts\xlr8\linalg.py", line 46, in mkl_dot
mkl_a, a_dbl = _create_mkl_sparse(matrix_a)
NameError: name '_create_mkl_sparse' is not defined
I also manually executed these statements:
from sparse_dot_mkl._mkl_interface._common import (MKL,
_check_return_value,
_create_mkl_sparse,
_destroy_mkl_handle,
_empty_output_check,
_is_allowed_sparse_format,
_order_mkl_handle, _type_check,
debug_print, debug_timer,
sparse_matrix_t)
from sparse_dot_mkl._sparse_sparse import _matmul_mkl
and successfully imported these statements too. But I am still encountering that NameError: '_create_mkl_sparse' is not defined.
Could you please help me with this or look into this issue?
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.