module Ollama::Utils::Math
def norm(vector)
-
(Float)
- The magnitude of the vector.
Parameters:
-
vector
(Array
) -- The input vector.
def norm(vector) s = 0.0 vector.each { s += _1.abs2 } Math.sqrt(s) end
(Float)
- The magnitude of the vector.
vector
(Array
)
-- The input vector.
def norm(vector) s = 0.0 vector.each { s += _1.abs2 } Math.sqrt(s) end