January 2018
Intermediate to advanced
474 pages
10h 23m
English
To change the LSTM example in the last section to the GRU network, change the cell type as follows and the TensorFlow takes care of the rest for you:
cell = tf.nn.rnn_cell.GRUCell(state_size)
The complete code for the GRU model is provided in the notebook ch-07a_RNN_TimeSeries_TensorFlow.
For the small airpass dataset, the GRU has shown better performance for the same number of epochs. In practice, GRU and LSTM have shown comparable performance. In terms of execution speed, the GRU model trains and predicts faster as compared to the LSTM.
The complete code for the GRU model is provided in the Jupyter notebook. The results from the GRU model are as follows:
train mse = 0.0019633215852081776 test mse = 0.014307591132819653 ...
Read now
Unlock full access