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

Masking operation errornous #22

Open
zaxliu opened this issue Jul 26, 2016 · 0 comments
Open

Masking operation errornous #22

zaxliu opened this issue Jul 26, 2016 · 0 comments

Comments

@zaxliu
Copy link

zaxliu commented Jul 26, 2016

Hi @JonathanRaiman , first off thanks for setting up this repo. Learned a lot from your implementation.

I have a question regarding the masking operation for variable length inputs. You mentioned in docs that

Elementwise mutliply this mask with your output, and then apply your objective function to this masked output. The error will be obtained everywhere, but will be zero in areas that were masked, yielding the correct error function.

But by doing so you only cuts off the back-propagation (BP) paths from masked outputs, whereas the BP paths from unmasked outputs via masked hidden units remain. The resulting loss function is still errornous.

I notice from other LSTM implementations (e.g. Lasagne) that the usual approach is to use the mask to switch between previous hidden states (if current input is masked) and computed hidden states (otherwise). In this way, both type of unwanted BP paths (masked outputs -> masked hidden -> weight & unmasked outputs -> masked hidden -> weight.)

Plz correct me if I'm wrong. Am I missing something?

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

1 participant