Loading tutorials
Dataset and DataLoader, and understand what training and validation mean. By the end you will have a folder layout that torchvision.datasets.ImageFolder loads. The images will be split so that your evaluation numbers can be trusted6 min readtrain and val folders. You will learn which transforms a pretrained model needs, which ones6 min readnn.Module, state_dict), what a convolutional network does with an image, and the loop of loss, gradient and epoch. It also assumes you have a train_ds from ImageFolder, as built in the earlier chapters on data loading.5 min readrequires_grad means. It also assumes you have a ResNet-18 with a new fc head and a run_epoch function like the ones in the earlier chapters. Here you decide which parameters get trained, and when.6 min readtrain_loader, val_loader, model (with a new head), criterion, optimizer, and device in the earlier chapters. Here you will write the loop that co5 min readfc head, a run_epoch function, and train_loader and val_loader. You should also know what a learning rate does in gradient descent and how requires_grad controls which parameters train.5 min readval_tfms, train_ds, model, device and num_classes objects from the earlier chapters. It also assumes you know what accuracy is. You will learn to measure how well the model will do on images it has never seen, and to read the re5 min readtrain() and eval() modes, the run_epoch helper, and how to read accuracy and loss. Here you learn to spot overfitting in your training logs, tell it apart fr5 min readImageFolder dataset with train and validation splits, a pretrained ResNet-18 with a new head, and the run_epoch function from the training chapter. You should also know what accuracy and a confusion matrix are.6 min readshuffle=False from ImageFolder, as in the earlier chapters. It also assumes you know what a confusion matrix is. The code below uses model, val_ds, val_loader, and device from those chapters.5 min read