Skip to content

Commit 7653194

Browse files
committed
Merge branch 'master' of https://github.com/ml5js/ml5-library
2 parents 95c39fb + 0c4d4fc commit 7653194

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
## Friendly machine learning for the web!
1111

12-
ml5.js aims to make machine learning accessible to a broad audience of artists, creative coders, and students. The library provides access to machine learning algorithms and models in the browser, building on top of [TensorFlow.js](https://js.tensorflow.org/) with no other external dependencies.
12+
ml5.js aims to make machine learning approachable for a broad audience of artists, creative coders, and students. The library provides access to machine learning algorithms and models in the browser, building on top of [TensorFlow.js](https://js.tensorflow.org/) with no other external dependencies.
1313

1414
The library is supported by code examples, tutorials, and sample data sets with an emphasis on ethical computing. Bias in data, stereotypical harms, and responsible crowdsourcing are part of the documentation around data collection and usage.
1515

src/Word2vec/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ class Word2Vec {
9696

9797
static nearest(model, input, start, max) {
9898
const nearestVectors = [];
99-
Object.keys(model).forEach((vector) => {
100-
const distance = tf.util.distSquared(input.dataSync(), model[vector].dataSync());
101-
nearestVectors.push({ vector, distance });
99+
Object.keys(model).forEach((word) => {
100+
const distance = tf.util.distSquared(input.dataSync(), model[word].dataSync());
101+
nearestVectors.push({ word, distance });
102102
});
103103
nearestVectors.sort((a, b) => a.distance - b.distance);
104104
return nearestVectors.slice(start, max);

0 commit comments

Comments
 (0)