hungpthanh / GRU4REC-pytorch

An other implementation of GRU4REC using PyTorch
Apache License 2.0
243 stars 55 forks source link

question about mask in data_loader #2

Open yuqianghan opened 5 years ago

yuqianghan commented 5 years ago

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!

hungpthanh commented 5 years ago

@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 :(

mmaher22 commented 5 years ago

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 ?

yuqianghan commented 4 years ago

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.