Huge accuracy gap between candle and pytorch on CIFAR-10 simple CNN #2984
Unanswered
tsubakisakura
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Issue: Huge Accuracy Gap Between Candle and PyTorch on CIFAR-10 CNN
Hi, I've been comparing Candle and PyTorch implementations of a simple CNN on CIFAR-10. Despite trying to replicate the same architecture and training settings, there's a large accuracy gap between the two:
Repositories & Code
I've created a minimal public repository for comparison:
https://github.com/tsubakisakura/compare-candle-pytorch
Implementation
nn.CrossEntropyLoss()
candle_nn::loss::cross_entropy(logits, target)
AdamW(lr=1e-3, weight_decay=0.01)
AdamW
with same parametersLogs
PyTorch
Candle
Question
I assume Candle is working correctly, but the results differ so much that I'm beginning to doubt whether I may have made a mistake in how I wrote the model or training loop.
Am I missing something in terms of how to correctly express the model or loss function in Candle?
Any suggestions or insight would be greatly appreciated.
Thanks a lot in advance!
Beta Was this translation helpful? Give feedback.
All reactions