MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / createDenseModel

Function createDenseModel

mnist/index.js:99–105  ·  view source on GitHub ↗

* Creates a model consisting of only flatten, dense and dropout layers. * * The model create here has approximately the same number of parameters * (~31k) as the convnet created by `createConvModel()`, but is * expected to show a significantly worse accuracy after training, due to the * fact th

()

Source from the content-addressed store, hash-verified

97 * @returns {tf.Model} An instance of tf.Model.
98 */
99function createDenseModel() {
100 const model = tf.sequential();
101 model.add(tf.layers.flatten({inputShape: [IMAGE_H, IMAGE_W, 1]}));
102 model.add(tf.layers.dense({units: 42, activation: 'relu'}));
103 model.add(tf.layers.dense({units: 10, activation: 'softmax'}));
104 return model;
105}
106
107/**
108 * This callback type is used by the `train` function for insertion into

Callers 1

createModelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected