key-value-memory-networks icon indicating copy to clipboard operation
key-value-memory-networks copied to clipboard

GRU Sentence Encoding API for tf 1.10+

Open BorisPolonsky opened this issue 6 years ago • 1 comments
trafficstars

The code ran into error when I tried running the simple_gru approach`. It seems like some of the code are not updated to tf 1.10 API. (I ran in tf 1.12.0 API which should be compatible with tf 1.10 API indicated your commit log as far as I know). I made the following modification and the model is now runable (although it does not outperform the original BOW approach):

  • x = tf.split(0, self._story_size, x) -> x = tf.split(x, self._story_size, axis=0)

  • q = tf.split(0, self._query_size, q) - > q = tf.split(q, self._query_size, axis=0)

  • doc_output, _ = tf.nn.rnn(k_rnn, x, dtype=tf.float32) -> doc_output, _ = tf.nn.static_rnn(doc_output, _ = tf.nn.static_rnn(k_rnn, x, dtype=tf.float32)

  • q_output, _ = tf.nn.rnn(q_rnn, q, dtype=tf.float32) -> q_output, _ = tf.nn.static_rnn(q_rnn, q, dtype=tf.float32)

Please let me now if this implementation is different from your original intent as I've never used 0.9 version of tf and couldn't find the doc

Thanks for your exemplary work.

BorisPolonsky avatar Mar 29 '19 07:03 BorisPolonsky

I believe I forgot to update GRU code when tf updated to 1.10 since GRU didn't outperform BOW.

siyuanzhao avatar Mar 29 '19 17:03 siyuanzhao