* Build a linear-regression model for the temperature-prediction problem. * * @param {tf.Shape} inputShape Input shape (without the batch dimenson). * @returns {tf.LayersModel} A TensorFlow.js tf.LayersModel instance.
(inputShape)
| 88 | * @returns {tf.LayersModel} A TensorFlow.js tf.LayersModel instance. |
| 89 | */ |
| 90 | function buildLinearRegressionModel(inputShape) { |
| 91 | const model = tf.sequential(); |
| 92 | model.add(tf.layers.flatten({inputShape})); |
| 93 | model.add(tf.layers.dense({units: 1})); |
| 94 | return model; |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Build a GRU model for the temperature-prediction problem. |