- Load in pre-trained weights from a network trained on a large dataset
- Freeze all the weights in the lower (convolutional) layers: the layers to freeze are adjusted depending on similarity of new task to original dataset
- Replace the upper layers of the network with a custom classifier: the number of outputs must be set equal to the number of classes
- Train only the custom classifier layers for the task thereby optimizing the model for smaller dataset.
Loading in a pre-trained model in PyTorch is simple:
from torchvision import models
model = model.vgg16(pretrained=True)
Source: https://towardsdatascience.com/transfer-learning-with-convolutional-neural-networks-in-pytorch-dd09190245ce
I think the pretrained keyword argument is something that has to do with the vgg16 model but should not be complicated to implement.
Loading in a pre-trained model in PyTorch is simple:
Source: https://towardsdatascience.com/transfer-learning-with-convolutional-neural-networks-in-pytorch-dd09190245ce
I think the
pretrainedkeyword argument is something that has to do with thevgg16model but should not be complicated to implement.