I am working on a simple challenge to predict shape images. My training loss keeps increasing.
Why would this be the case for such a use case prediction?
download a pre-trained network
model = models.densenet121(pretrained=True)
freeze the features of the pre-trained network
for param in model.parameters():
param.requires_grad = False
model.classifier = ShapesNetwork.ShapesNet(1024,2,[256])
criterion = nn.NLLLoss()
optimizer = optim.Adam(model.classifier.parameters(), lr=1e-4)
print(model)
ShapesNetwork.train(model,trainloader,testloader,criterion,optimizer,epochs=3)
print results are:
Epochs: 1/3 Training Loss: 0.874
Epochs: 2/3 Training Loss: 1.576
Epochs: 3/3 Training Loss: 2.260
My data set has 100 images each for circles and for squares.