5 ms·
# shuffle the combined batch to prevent the model from learning order indices = torch.randperm(combined_images.size(0)) combined_images = combin
by toxik 2y ago
# shuffle the combined batch to prevent the model from learning order
indices = torch.randperm(combined_images.size(0))
combined_images = combined_images[indices]
combined_labels = combined_labels[indices]
You don’t need to do this
- Two_hands 2y agoIs it better to train without the shuffling or shuffling has negligible effects?
- Doxin 2y agoI'd assume there's no real state the network can "remember" between iterations, so shuffling will at best just waste time.
- Two_hands 2y agoMy thoughts had been related to the ordering, but it makes sense that it doesn’t matter. I have read that it is actually better to train the model in separate batches with generated and real images in their own batches before the gradient step.