farizrahman4u / seq2seq

Sequence to Sequence Learning with Keras
GNU General Public License v2.0
3.17k stars 846 forks source link

Bug in AttentionDecoderCell ? ? #248

Open jjwangnlp opened 6 years ago

jjwangnlp commented 6 years ago

Dear authors, I have three questions as follows:

Firstly,

https://github.com/farizrahman4u/seq2seq/blob/c020ccfc1fa3a651be272f8b4be48a10f9c3f0fa/seq2seq/cells.py#L87

noted: output_shape=(input_dim + hidden_dim,) should it be ->-> output_shape=(input_length, input_dim + hidden_dim)???

Additionally, the same issue with #219 ,

instead of this:

https://github.com/farizrahman4u/seq2seq/blob/c020ccfc1fa3a651be272f8b4be48a10f9c3f0fa/seq2seq/cells.py#L85

shouldn't it be this (input_dim -> hidden_dim):

C = Lambda(lambda x: K.repeat(x, input_length), output_shape=(input_length, hidden_dim))(c_tm1)

Because c_tm1 has dimensionality of hidden_dim

Finally,

https://github.com/farizrahman4u/seq2seq/blob/c020ccfc1fa3a651be272f8b4be48a10f9c3f0fa/seq2seq/cells.py#L89

line 89: alpha = W3(_xC) Here, did "Dense" play the same role as "TimedistributedDense" in keras? ?