For training the LSTM model, we will use the following code:
# Fit model
model_one <- model %>% fit(train_x, train_y,
epochs = 10,
batch_size = 128,
validation_split = 0.2)
plot(model_one)
We will use train data to fit the LSTM model with ten epochs and use a batch size of 128. We will also reserve 20% of train data as validation data for assessing loss and accuracy values during model training.