Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about mask in data_loader #2

Open
yuqianghan opened this issue Jun 15, 2019 · 3 comments
Open

question about mask in data_loader #2

yuqianghan opened this issue Jun 15, 2019 · 3 comments

Comments

@yuqianghan
Copy link

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
Copy link
Owner

@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
Copy link
Contributor

mmaher22 commented Sep 27, 2019

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants