* 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)
| 24 | * @returns {tf.Sequential} The multi layer perceptron regression mode l. |
| 25 | */ |
| 26 | function 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 | |
| 44 | module.exports = createModel; |
no outgoing calls
no test coverage detected