Skip to content

Commit

Permalink
Merge pull request #57 from papalotis/patch-1
Browse files Browse the repository at this point in the history
User Input needs to be normalized
  • Loading branch information
shiffman authored Feb 11, 2018
2 parents 3e5ef5f + 7b165d5 commit eacfdf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/mnist/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function guessUserDigit() {
img.resize(28, 28);
img.loadPixels();
for (let i = 0; i < 784; i++) {
inputs[i] = img.pixels[i * 4];
inputs[i] = img.pixels[i * 4] / 255;
}
let prediction = nn.predict(inputs);
let guess = findMax(prediction);
Expand Down

0 comments on commit eacfdf0

Please sign in to comment.