<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>TensorSpace - Hello World</title>
  <meta name="author" content="syt123450 / https://github.com/syt123450">

  <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/101/three.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/tween.js/17.2.0/Tween.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/tensorflow/1.0.0-alpha3/tf.min.js"></script>
  <script src="https://tensorspace.org/assets/jslib/TrackballControls.js"></script>
  <script src="https://tensorspace.org/assets/jslib/tensorspace.min.js"></script>

  <script src="https://raw.githack.com/syt123450/tensorspace-data/master/data/5.js"></script>

</head>

<body>

  <div id="container"></div>

</body>

</html>
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

#container {
  width: 100%;
  height: 100%;
}
let modelContainer = document.getElementById("container");
let model = new TSP.models.Sequential(modelContainer);

model.add(new TSP.layers.GreyscaleInput({ shape: [28, 28, 1] }));
model.add(new TSP.layers.Padding2d({ padding: [2, 2] }));
model.add(new TSP.layers.Conv2d({ kernelSize: 5, filters: 6, strides: 1 }));
model.add(new TSP.layers.Pooling2d({ poolSize: [2, 2], strides: [2, 2] }));
model.add(new TSP.layers.Conv2d({ kernelSize: 5, filters: 16, strides: 1 }));
model.add(new TSP.layers.Pooling2d({ poolSize: [2, 2], strides: [2, 2] }));
model.add(new TSP.layers.Dense({ units: 120 }));
model.add(new TSP.layers.Dense({ units: 84 }));
model.add(
  new TSP.layers.Output1d({
    units: 10,
    outputs: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
  })
);

model.load({
  type: "keras",
  url: "https://tensorspace.org/assets/model/lenet/mnist.json",
  onComplete: function() {
    console.log('"Hello World!" from TensorSpace Loader.');
  }
});
model.init(function() {
  model.predict(data5);
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.