MCPcopy Create free account
hub / github.com/chinawithfrank/ChatBotCourse / vector_sqrtlen

Function vector_sqrtlen

chatbotv2/my_seq2seq.py:78–83  ·  view source on GitHub ↗
(vector)

Source from the content-addressed store, hash-verified

76 file_object.close()
77
78def vector_sqrtlen(vector):
79 len = 0
80 for item in vector:
81 len += item * item
82 len = math.sqrt(len)
83 return len
84
85def vector_cosine(v1, v2):
86 if len(v1) != len(v2):

Callers 1

vector_cosineFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected