GRU4REC-pytorch icon indicating copy to clipboard operation
GRU4REC-pytorch copied to clipboard

question about mask in data_loader

Open yuqianghan opened this issue 5 years ago • 3 comments

Hi, I have a question about the "mask" in DataLoader(),

for i in range(minlen - 1):
     idx_input = idx_target
     idx_target = df.item_idx.values[start + i + 1]
     input = torch.LongTensor(idx_input)
     target = torch.LongTensor(idx_target)
     yield input, target,  mask

'mask' is all the same during the for loop, but I think it should be reset to [] after the first loop. Otherwise, the reset_hidden() will always reset the hidden state. Could you check it, Thank you!

yuqianghan avatar Jun 15 '19 07:06 yuqianghan

@HAN-Yuqiang thank you for your question. Currently, I am very busy at my company, so I have no time to check your issue right now :( I will try to check it as soon as possible. Sorry about that :(

hungpthanh avatar Jun 18 '19 03:06 hungpthanh

Hi, I have a question about the "mask" in DataLoader(),

for i in range(minlen - 1):
     idx_input = idx_target
     idx_target = df.item_idx.values[start + i + 1]
     input = torch.LongTensor(idx_input)
     target = torch.LongTensor(idx_target)
     yield input, target,  mask

'mask' is all the same during the for loop, but I think it should be reset to [] after the first loop. Otherwise, the reset_hidden() will always reset the hidden state. Could you check it, Thank you!

@HAN-Yuqiang You mean mask reset after yield statement, Right ?

mmaher22 avatar Sep 27 '19 14:09 mmaher22

Hi, I have a question about the "mask" in DataLoader(),

for i in range(minlen - 1):
     idx_input = idx_target
     idx_target = df.item_idx.values[start + i + 1]
     input = torch.LongTensor(idx_input)
     target = torch.LongTensor(idx_target)
     yield input, target,  mask

'mask' is all the same during the for loop, but I think it should be reset to [] after the first loop. Otherwise, the reset_hidden() will always reset the hidden state. Could you check it, Thank you!

@HAN-Yuqiang You mean mask reset after yield statement, Right ?

Yes, I think it should be that.

yuqianghan avatar Nov 12 '19 07:11 yuqianghan