hi,
can anyone please explain to me how to understand to the final layer for finetuning the convnet. i am following blow tutorial and need use for inception_v3 as trained model
https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html 26
ones, i have changed input image size and want to know how to modify below code instead of resnet18
model_ft = models.inception_v3(pretrained=True)
num_ftrs = model_ft.fc.in_features
model_ft.fc = nn.Linear(num_ftrs, 2)

model_ft = model_ft.to(device)

criterion = nn.CrossEntropyLoss()

# Observe that all parameters are being optimized
optimizer_ft = optim.SGD(model_ft.parameters(), lr=0.001, momentum=0.9)

# Decay LR by a factor of 0.1 every 7 epochs
exp_lr_scheduler = lr_scheduler.StepLR(optimizer_ft, step_size=7, gamma=0.1)