February 2018
Intermediate to advanced
262 pages
6h 59m
English
Let's freeze all the layers of the features model, which contains the convolutional block. Freezing the weights in the layers will prevent the weights of these convolutional blocks. As the weights of the model are trained to recognize a lot of important features, our algorithm would be able to do the same from the very first iteration. The ability to use models weights, which were initially trained for a different use case, is called transfer learning. Now let's look at how we can freeze the weights, or parameters, of layers:
for param in vgg.features.parameters(): param.requires_grad = False
This code prevents the optimizer from updating the weights.
Read now
Unlock full access