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

Function buildLinearRegressionModel

jena-weather/models.js:90–95  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

88 * @returns {tf.LayersModel} A TensorFlow.js tf.LayersModel instance.
89 */
90function 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.

Callers 1

buildModelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected