Thank you! This is exactly what I needed, there were some incorrect loops in my thinking.



 ptrblck:

Do you mean the index by “datum id”? If so, you could just return the index with the data and target in your Dataset .
…
Your code looks alright. It seems you are using pandas to map some IDs to the data,


I meant the ID that I’m mapping through pandas with. It’s not really necessary, except that it allows me to refer to the original data easily. So that’s what I’ll add to my dataloader outputs.



 ptrblck:

I’m not sure what you’re doing with Vaccuracies ,


You’re right. I don’t need these. They are just copy/paste legacies.
I noticed your no_grad() environment:



 ptrblck:

with torch.no_grad():


I haven’t seen this in examples yet. Is there a comparable environment I could be using during training to eliminate the optimizer.zero_grad(), loss.backward(), and optimizer.step() lines?
Your confusion matrix is also exactly was I was looking for. Many thanks.