In the previous video, you looked at RNNs and how
you could use RNNs to do some simple prediction.
You then improved on them,
using LSTMs instead of
RNNs to get a better fit with our predicted data.
In this video, you'll take a look at
the LSTM notebook after
which you can try that notebook out for yourself.
As always, let's ensure that we're
using TensorFlow too, before starting.
And now that we see that we are,
let's run this code to create the data,
and then the helper function
that we'll turn it into a dataset.
Will then run our model,
which has two LSTM layers.
You can of course change this,
but we'll run it to find our optimum learning rate first.
Once it's done, we can plot
the loss versus the learning rates,
and we'll find a good learning rate
is about ten to the minus five.
So, we'll update our learning rates of that.
I will train it for about 500 epochs.
When it's done, we'll plot the forecast.
As we can see, it's definitely improved.
Changing to LSTMs gets rid of that plateau that we saw,
and the curve is closer to the data,
but it's still not quite right,
and it gives us an MAE of a little over 8.5.
So, that's a good start in using
recurrent neural networks to fix the problem.
Have a play with a notebook
and see if you can improve on it.
Next week, we're going to do one more thing,
and that's adding a convolutional layer before
the LSTMs to see the impact on training.
After that, you'll start moving away from
synthetic data and you'll
start using the real-world stuff.