I am new to Pytorch and CNN and am currently working on this network but as I increase the batch size or change the learning rate it doesn’t seem to improve. I have been reading about changing the last layers. I am not sure how to implement that in my current model, though. Any ideas on how I could do that? Thanks.
transformations = transforms.Compose([
    #transforms.Resize((800,600),interpolation=Image.BICUBIC),
    transforms.Resize(256),
    transforms.RandomHorizontalFlip(),
    transforms.RandomVerticalFlip(),
    transforms.ColorJitter(brightness=0.1,saturation=10,contrast=30,hue=0.1),
    #transforms.CenterCrop(224),
    transforms.ToTensor()])

resnet50=models.resnet50()

# Change the last layer
num_ftrs = resnet50.fc.in_features
resnet50.fc = nn.Linear(num_ftrs, 17)

model =resnet50.to(device)
print(model)
optimizer = torch.optim.SGD(model.parameters(), lr=LR)
criterion = nn.BCEWithLogitsLoss()