Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cosdata/cosdata
/ magnitude
Function
magnitude
tests/load-test.py:214–215 ·
view source on GitHub ↗
(vec)
Source
from the content-addressed store, hash-verified
212
213
214
def
magnitude(vec):
215
return
np.sqrt(sum(v**2
for
v in vec))
216
217
218
def
cosine_similarity(vec1, vec2):
Callers
1
cosine_similarity
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected