Tuning hyperparameters to improve performance

To improve our model, we will now tune our hyperparameters. There are a number of options for tuning our LSTM model. We will focus on adjusting the length value when creating the time-series data with our data generator. In addition, we will add additional layers, adjust the number of units in the layer, and modify our optimizer.

We will do so using the following steps:

  1. To get started, let's switch the value that we pass to the length argument in the timeseries_generator function from 3 to 10 so that our model has a longer window of prices to use for forecasting calculations. To make this change, we run the following code:
train_gen <- timeseries_generator(  closing_deltas,  closing_deltas,  

Get Hands-On Deep Learning with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.