Machine-Learning-Collection icon indicating copy to clipboard operation
Machine-Learning-Collection copied to clipboard

Better set shuffle=False for the test_loader

Open iCurious-D opened this issue 11 months ago • 0 comments

As I work through the .py files in Machine-Learning-Collection/tree/master/ML/Pytorch/Basics, I noticed that most of them, when creating the test_loader, the shuffle parameter is set to true. train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=True) test_loader = DataLoader(dataset=test_dataset, batch_size=batch_size, shuffle=True)

But for the test_loader, it is generally better not to use shuffle=True. Not shuffling the test data makes it easier to track and understand the model's performance. For instance, if you are reviewing predictions for specific samples, a fixed order allows you to locate these samples more conveniently.

Thank you for your amazing job, really learnt a lot from this repo.

iCurious-D avatar Dec 10 '24 07:12 iCurious-D