blitz-bayesian-deep-learning
blitz-bayesian-deep-learning copied to clipboard
classification with freeze_ and unfreeze_
Hi,
First of all, I very much appreciate your wonderful work!
Currently, I am testing CIFAR10 classification task with your example code.
I would like to ask whether 10% of the test performance is an usual case when I call freeze_()
in the test time.
# Test Time
with torch.no_grad():
for data in test_loader:
images, labels = data
classifier.freeze_()
outputs = classifier(images.to(device))
_, predicted = torch.max(outputs.data, 1)
total += labels.size(0)
correct += (predicted == labels.to(device)).sum().item()
print(f'Freeze Epoch {epoch} | {str(100 * correct / total)}% | Elpased: {time.time() - tic:.1f}s')
classifier.unfreeze_()
I only add classifier.freeze_()
before getting outputs
.
I thought the accuracy should be similar with unfreeeze_()
, however, it seems not.
When I activated freeze
mode, I got 10%, but unfreeze
mode reach 45% at the first epoch.
Since I only activate it at the test time, the training loss keeps going down.
Best Regards, YJ
This is not usual and should be fixed by now.
The problem is still there.