From the course: PyTorch Essential Training: Deep Learning

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Validation and testing

Validation and testing

- [Instructor] Validation and testing are important parts of model development as they take care that overfitting does not occur and that the model performs well against unseen data. Learn the key steps of each of them. In the validation step, we use a separate set of data, which we haven't used previously in training and call this set validation set. The main goal is tuning hip parameters such as learning rate or number of epochs, so we can provide an early indication of how our model is performing. We have already imported libraries and dataset. Next, we define a neural network with init and forward function. After that, we instantiate the model and define the loss function and optimizer. To load and transform the data, we will create transformations for the training data. We'll create validation set from our training data by using torch.utils.data.randomsplit, which splits the training data into the training set of 40,000 images and validation set of 10,000 images. Then we set up…

Contents