convolutional neural networks the pretrained network has six layers the original network was used to classify , distinct objectshencethe last layer has , output connections howeverour use case is simple binary classification exercisethereforewe need to replace the final layer to suit our use case listing - replaces the last layer in the pretrained network with custom layer that outputs single unit with sigmoid activation listing - replacing the last layer with our custom layer #define our custom model last layer new_model classifier[ nn sequentialnn linear(new_model classifier[ in_features )nn relu()nn dropout( )nn linear( )nn sigmoid()find total parameters and trainable parameters total_params sum( numel(for in new_model parameters()print( '{total_params:,total parameters 'total_trainable_params sum numel(for in new_model parameters(if requires_gradprint( '{total_trainable_params:,training parameters 'output[ , , total parameters , , training parameters herewe have leveraged the existing layers of the vgg pretrained model and added newfully connected layer towards the end to tailor the network structure for our binary use case all the layersapart from