(inputShape, dropout, recurrentDropout)
| 142 | * @returns {tf.LayersModel} A TensorFlow.js GRU model. |
| 143 | */ |
| 144 | export 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. |
no outgoing calls
no test coverage detected