56 lines
1.2 KiB
HTML
56 lines
1.2 KiB
HTML
<!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>
|
|
|
|
|
|
|