-
Notifications
You must be signed in to change notification settings - Fork 703
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
Modify BiRNNBuilder to get easy access to the final hidden states of the component RNNs #263
base: master
Are you sure you want to change the base?
Conversation
Python works in Windows, including MKL and/or GPU support
Added set_s function for rnns
…s, removing them from install help.
# Conflicts: # examples/CMakeLists.txt
…be compiled in Windows.
Removing multiprocess examples from Windows build and simplifying windows build instructions to reflect latest Eigen version
add the -O1/-O2 swith for the gcc4.9 or later versions.
…ith extension name != filename in cython
Bugfix in vanillalstm serialization
Fixing MKL build for OS X
Added explicit instructions for Mac and explicit installation instructions for eigen.
Added Mac installation instructions and eigen
A pull request for clab#242 (greedy decoding and vectorization in attention.py)
transduce_final that is the concatenation of the hidden states of both directions.
If I understand correctly what you are trying to achieve with
? also, I find the name |
Yes, I believe it is equivalent, but add_inputs constructs and collects all the intermediate states as data structures in python list, but you only care about the last one of each of the two RNNs. I'll benchmark if there is a performance difference, especially on longer sequences. And, yes, it definitely needs a better name. |
Did anything happen on this pull request? I think it'd be nice to have if the various issues can be resolved. |
First, I'd like to say I support the BiLSTM hegemony. However, I haven't done the benchmarking I've promised. If someone can think of a better name than "transduce_final", that would motivate me to do it! |
What about |
Why just BiRNNs? Shouldn't any RNN allow efficiently getting just the final state? |
@danielhers Yeah, actually this seems like a really nice solution. @yoavg might have opinions, but I'd be happy to have a pull request to this effect. |
for the one-directional RNN, I think for the bi-RNNs, note that the semantics of I don't care that much about the name that will finally be chosen, as long as its properly documented. |
@bskaggs What do you think about the |
@neubig: sounds like a good option! Should I take crack at implementing it? |
@bskaggs Sorry, I totally missed your response. Yes, I think this would be worth doing! |
In situations where you are using BiRNNs to output a fixed sized state for a variable-length sequence, it is convenient to build it from the hidden states of the two constituent RNNs at the final layer.
This request refactors
BiRNNBuilder
to unifytransduce
andadd_inputs
, and adds atransduce_final
function that produces an expression that is the concatenation of the last element of h() for the last states of the two RNNs at the last layer. (I think this the state I want, but please correct me if that doesn't make sense. Also, I'll caveat that Python isn't my strongest language, so I'd appreciate any style and naming comments!)Also, I was confused by the near duplicate existing definition of
BiRNNBuilder
inpython/dynet_viz.py
andpython/_dynet.pyx
so I made them the same. ¯\_(ツ)_/¯