-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ApelSYN/master
I adjusted incorrectly resource files
- Loading branch information
Showing
15 changed files
with
96 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
debug.html | ||
debug.html | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>MNIST Digits Simples</title> | ||
<script src="./dist/mnist.js"></script> | ||
<script> | ||
window.onload = function() { | ||
var simplesCount = 20; | ||
var size = 28; | ||
var canvas = document.getElementById("mnistCanvas"); | ||
canvas.height = size*simplesCount; | ||
var ctx = canvas.getContext("2d"); | ||
|
||
var canvasData = ctx.getImageData(0, 0, canvas.width, canvas.height); | ||
var colOffset, rowOffcet; | ||
|
||
for (var col=0;col < 10; col++) { | ||
colOffset = col*size; | ||
var digits = mnist[col].range(0, simplesCount-1); | ||
for (var row=0;row < simplesCount; row++) { | ||
var digit = digits[row]; | ||
rowOffcet = row*size; | ||
for (var i = 0; i < digit.length; i++) { | ||
var pointColor = digit[i] * 255; | ||
var position = (colOffset+(rowOffcet + Math.floor(i/size))*canvas.width) + (i % size); | ||
canvasData.data[position * 4 + 0] = 255-pointColor; | ||
canvasData.data[position * 4 + 1] = 255-pointColor; | ||
canvasData.data[position * 4 + 2] = 255-pointColor; | ||
canvasData.data[position * 4 + 3] = 255; | ||
} | ||
} | ||
} | ||
ctx.putImageData(canvasData, 0, 0); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<h1>MNIST Digits Simples</h1> | ||
<canvas id="mnistCanvas" width="280" height="280"> | ||
Your browser does not support the HTML5 canvas tag. | ||
</canvas> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters