But I'd like to add a couple of new layers to this,
layers that use the Lambda type.
This type of layer is one that allows us to perform
arbitrary operations to effectively
expand the functionality of TensorFlow's kares,
and we can do this within the model definition itself.
So the first Lambda layer will be
used to help us with our dimensionality.
If you recall when we wrote
the window dataset helper function,
it returned two-dimensional batches
of Windows on the data,
with the first being the batch size
and the second the number of timestamps.
But an RNN expects three-dimensions;
batch size, the number of timestamps,
and the series dimensionality.
With the Lambda layer,
we can fix this without
rewriting our Window dataset helper function.
Using the Lambda, we just
expand the array by one dimension.
By setting input shape to none,
we're saying that the model can take
sequences of any length.
Similarly, if we scale up the outputs by 100,
we can help training.
The default activation function in
the RNN layers is tan H
which is the hyperbolic tangent activation.
This outputs values between negative one and one.
Since the time series values are in
that order usually in the 10s like 40s, 50s,
60s, and 70s, then scaling up
the outputs to the same ballpark
can help us with learning.
We can do that in a Lambda layer too,
we just simply multiply that by a 100.
So let's now take a look at what it takes to build out
the full RNN so we
can start doing some predictions with it.
You'll see that in the next video.