Day 5: Transfer learning - impact of the number of hidden layers 1
In one of discussion with my fellow scholars, I want to find out the effect of number of hidden layers defined in a model. Some says 2 or 3 hidden layers is the number of optimum hidden layers. The larger the number of hidden layer, the more your model will overfit the data, and can't generalize any solution. That mean you will get a higher loss. The larger number take more time to train your model too. The lesser number of hidden layer cause underfitting. I want to check that by modifyng the Lesson 2 Part 8 code. First prepare the trainloader and testloader data. %matplotlib inline %config InlineBackend.figure_format = 'retina' import time import matplotlib.pyplot as plt import torch from torch import nn from torch import optim import torch.nn.functional as F from torchvision import datasets, transforms, models data_dir = 'Cat_Dog_data' # Define transforms for the training data and testing data train_transforms = transforms.Compose([transforms....