Search⌘ K

Assignment Solution

Learn to build and optimize a Pokemon image classifier using transfer learning with ResNet50, MobileNet, and AlexNet models. This lesson guides you through adjusting model architecture and hyperparameters to enhance accuracy while practical coding examples demonstrate integrating pre-trained models and freezing layers during training.

We'll cover the following...

Problem One

Change the hyperparameters, the number of layers in our classifier, and the number of layers up to which we want to freeze the weight update process and see what the accuracy of the model is. How does it change?

We will only change the model architecture here but you can even change the epochs, the number of parameters to freeze for the training process, etc.

Python 3.5
# The ResNet50 model's output is going to be connected to this classifier.
av1 = GlobalAveragePooling2D()(model.output)
fc1 = Dense(256, activation = 'relu')(av1)
d1 = Dropout(0.5)(fc1)
fc2 = Dense(128, activation = 'relu')(d1)
d2 = Dropout(0.5)(fc2)
fc3 = Dense(64, activation = 'relu')(d2)
d3 = Dropout(0.5)(fc3)
fc4 = Dense(10, activation = 'softmax')(d3)

Explanation:

  • We
...