tristandeleu / pytorch-meta

A collection of extensions and data-loaders for few-shot learning & meta-learning in PyTorch
https://tristandeleu.github.io/pytorch-meta/
MIT License
1.98k stars 256 forks source link

Fixing flaky test #117

Closed sleepy-owl closed 3 years ago

sleepy-owl commented 3 years ago

The test test_matching_log_probas sometimes fails when the assertion on line 86 fails. It failed 2/200 times for me. I think this is happening due to a rounding error in the log probabilities. As a result sometimes the value is rounded up to 0 causing the assertion to fail.

Re-running the test would reduce the failure rate to less than 1%. Do you guys think this makes sense? I will be happy to incorporate any suggestions that you guys may have.

Thanks!