MCPcopy
hub / github.com/tensorflow/tfjs-examples / buildGRUModel

Function buildGRUModel

jena-weather/models.js:144–157  ·  view source on GitHub ↗
(inputShape, dropout, recurrentDropout)

Source from the content-addressed store, hash-verified

142 * @returns {tf.LayersModel} A TensorFlow.js GRU model.
143 */
144export function buildGRUModel(inputShape, dropout, recurrentDropout) {
145 // TODO(cais): Recurrent dropout is currently not fully working.
146 // Make it work and add a flag to train-rnn.js.
147 const model = tf.sequential();
148 const rnnUnits = 32;
149 model.add(tf.layers.gru({
150 units: rnnUnits,
151 inputShape,
152 dropout: dropout || 0,
153 recurrentDropout: recurrentDropout || 0
154 }));
155 model.add(tf.layers.dense({units: 1}));
156 return model;
157}
158
159/**
160 * Build a model for the temperature-prediction problem.

Callers 2

models_test.jsFile · 0.90
buildModelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected