[go: nahoru, domu]

Skip to content

Commit

Permalink
and fixed the minimal cosine similarity to be -1 instead of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
tmikolov committed Dec 19, 2013
1 parent ab5da71 commit 5815e5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion distance.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int main(int argc, char **argv) {
for (a = 0; a < size; a++) len += vec[a] * vec[a];
len = sqrt(len);
for (a = 0; a < size; a++) vec[a] /= len;
for (a = 0; a < N; a++) bestd[a] = 0;
for (a = 0; a < N; a++) bestd[a] = -1;
for (a = 0; a < N; a++) bestw[a][0] = 0;
for (c = 0; c < words; c++) {
a = 0;
Expand Down

0 comments on commit 5815e5d

Please sign in to comment.