convolutional neural networks the ones we addedhave their weights frozen--that isthe model weights will not be updated during the training processexcept for the last fully connected layer let' now train the new model for our dataset for epochs all components remain similar to the previous example listing - demonstrates training the pretrained network for our use case listing - training the pretrained model for the defined use case #define epochsoptimizer and loss function num_epochs loss_function nn bceloss(#binary crosss entropy loss new_model cuda(adam_optimizer torch optim adam(new_model parameters()lr train the model total_step len(train_loaderprint("total batches:",total_stepfor epoch in range(num_epochs)new_model train(train_loss for (imageslabelsin enumerate(train_loader)images images to(devicelabels labels to(deviceforward pass outputs new_model(imagesloss loss_function(outputs float()labels float(view(- , )