-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<title>Simple speed test</title> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
|
||
<script src="../build/convnet.js"></script> | ||
|
||
<script> | ||
|
||
function logEvent(str) { | ||
console.log(str); | ||
var d = document.createElement('div'); | ||
d.innerHTML = str; | ||
document.getElementById('result').appendChild(d); | ||
} | ||
|
||
n = 0; | ||
dtall = 0; | ||
function runExample() { | ||
|
||
var t0 = +new Date(); | ||
layer.forward(x); | ||
//layer.backward(); | ||
var t1 = +new Date(); | ||
var diff = t1 - t0; | ||
dtall += diff; | ||
n++; | ||
|
||
logEvent('ran example ' + n + ' in ' + diff + 'ms, estimated average = ' + (dtall / n).toFixed(3) + 'ms'); | ||
} | ||
|
||
function start() { | ||
|
||
// Conv Layer definition used in convnet benchmarks | ||
opt = { in_sx:128, in_sy:128, in_depth:3, sx:11, filters:96, stride: 1, pad: 0}; | ||
layer = new convnetjs.ConvLayer(opt); | ||
x = new convnetjs.Vol(128, 128, 3); | ||
|
||
run1i = setInterval(runExample, 5); // start | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<button onclick="start()">Convolution Test Start</button> | ||
<button onclick="window.clearInterval(run1i);">Stop</button> | ||
<div id="result"></div> | ||
</body> | ||
</html> | ||
|
||
|
||
|