From the course: Building Deep Learning Applications with Keras
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Training models
From the course: Building Deep Learning Applications with Keras
Training models
- Let's continue on with training the model. Open up the exercise files under chapter four, find 'Train the Model Begin.py'. So let's start by defining history = model.fit, and in model.fit we are going to give it the (X_train_reshaped, y_train_scaled) and asking it to learn from those over 50 rounds. So another way of saying it is epochs. So we will set the epochs to 50. In each epoch, the model makes predictions, checks how far off those predictions are using the MSC, and then slightly adjust the weights of the neurons to do better next time. And the next is the batch size. So we will give the batch size to be 32. And this tells the model to look at 32 sequences at a time when it's learning. This is a balance between the speed of learning and the accuracy of the adjustments it makes. Next we will define validation_split to be 0.1. So we are holding back 10% of the training data to use as a validation set. This isn't used to train the model, but to test how well it's learning after…