86 lines (80 sloc) 2.08 KB
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
<!doctype html>
<link rel="stylesheet" href="" />
body {
font-family: monospace;
margin-left: 1em;
margin-top: 1em;
table, th, td {
border: 1px solid black;
padding: 0.5em;
table > thead {
font-weight: bold;
#controlSection {
padding-bottom: 1em;
.metadata {
padding-left: 1em;
<h1>TensorFlow.js Layers: Benchmarks Demo</h1>
<div id='controlSection'>
<button id="runBenchmarks">Run Benchmarks</button>
<span id="status">Standing by.</span>
Benchmark timestamp:<span class="metadata" id="benchmark-timestamp"></span>
navigator.userAgent:<span class="metadata" id="navigator-userAgent"></span>
TensorFlow.js Core version:<span class="metadata" id="tfjs-core-version"></span>
TensorFlow.js Layers version:<span class="metadata" id="tfjs-layers-version"></span>
Python Keras version:<span class="metadata" id="pyKerasVersion"></span>
TensorFlow Python version:<span class="metadata" id="tfVersion"></span>
TensorFlow uses GPU:<span class="metadata" id="tfUsesGPU"></span>
<!-- TODO(soergel): Add additional metadata here, such as:
* CPU information
* Number of cores
* Browser name
* WebGL version
<table id='resultsTable'>
<td>Model name</td>
<td>Model description</td>
<td>Batch size</td>
<td>fit() epochs</td>
<td>fit() (ms)<br/>Keras</td>
<td>fit() (ms)<br/>TF.js Layers</td>
<td>predict() (ms)<br/>Keras</td>
<td>predict() (ms)<br/>TF.js Layers</td>
<tbody id='resultsBody'>
<script src='index.js'></script>