I have a Dataset whose __getitem__ gives me a question and its correct answer (no problem here). Here’s my question: At every step, my model takes in 3 tensors:
the question
the correct answer
a random wrong answer from other questions
Obviously I would have no problem getting item 1 and 2, but how can I cleanly get item 3 without creating another dataset? I guess using data loader would be out of the question here (correct me if I’m wrong). Any suggestions?
You could just sample another index which is different to the one you are getting in __getitem__(self, index) and return this negative sample.
Something like this should work: