ikostrikov / ikostrikov/TensorFlow-Pointer-Networks

Why compute prediction over decoder_inputs instead of encoder_inputs?

Open
#3 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
203
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Hi,

Thanks for sharing the code. I have a doubt in _pointer.py_. In the below code fragment:
```python
if feed_prev and i > 0:
inp = tf.pack(decoder_inputs)
inp = tf.transpose(inp, perm=[1, 0, 2])
inp = tf.reshape(inp, [-1, attn_length, input_size])
inp = tf.reduce_sum(inp * tf.reshape(tf.nn.softmax(output), [-1, attn_length, 1]), 1)
inp = tf.stop_gradient(inp)
inps.append(inp)
```
Here you are computing inp from decoder_inputs, but at the test time, you wouldn't really have decoder_inputs. Shouldn't it be computed from encoder_inputs rather by indexing into them?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the feed_prev branch in _pointer.py_ and trace how decoder_inputs and encoder_inputs are supplied during training and test-time execution. Determine whether using decoder_inputs is intentional or a defect, then document the conclusion or update the implementation so the test-time input path is correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.