From 333457d935d89f2559342b31907d04d091520604 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 23 Nov 2020 08:44:23 -0500 Subject: [PATCH] --- Embedding.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Embedding.md b/Embedding.md index f9e46ef..a66423d 100644 --- a/Embedding.md +++ b/Embedding.md @@ -38,10 +38,12 @@ They can be stored as normal arrays and reused as needed Simmilarity function is based on *Eucilidean distance* between all points in vector *Eucliean distance is limited case of Minkowski distance with order of 2* -*[Minkowski distance](https://en.wikipedia.org/wiki/Minkowski_distance) is a nth root of sum of nth powers of distances between each point in (each value in 192-member array)* +*[Minkowski distance](https://en.wikipedia.org/wiki/Minkowski_distance) is a nth root of sum of nth powers of distances between each point (each value in 192-member array)* Changing `order` can make simmilarity matching more or less sensitive: ```js const distance = ((firstEmbedding.map((val, i) => (val - secondEmbedding[i])).reduce((dist, diff) => dist + (diff ** order), 0) ** (1 / order))); ``` + +*Once embedding values are calculated and stored, if you want to use stored embedding values without requiring `Human` library you can use above formula to calculate simmilarity on the fly.*