MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / createModel

Function createModel

abalone-node/model.js:26–42  ·  view source on GitHub ↗

* Builds and returns Multi Layer Perceptron Regression Model. * * @param {number} inputShape The input shape of the model. * @returns {tf.Sequential} The multi layer perceptron regression mode l.

(inputShape)

Source from the content-addressed store, hash-verified

24 * @returns {tf.Sequential} The multi layer perceptron regression mode l.
25 */
26function createModel(inputShape) {
27 const model = tf.sequential();
28 model.add(tf.layers.dense({
29 inputShape: inputShape,
30 activation: 'sigmoid',
31 units: 50,
32 }));
33 model.add(tf.layers.dense({
34 activation: 'sigmoid',
35 units: 50,
36 }));
37 model.add(tf.layers.dense({
38 units: 1,
39 }));
40 model.compile({optimizer: tf.train.sgd(0.01), loss: 'meanSquaredError'});
41 return model;
42}
43
44module.exports = createModel;

Callers 2

model_test.jsFile · 0.70
runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected