shentianxiao / language-style-transfer

Apache License 2.0
553 stars 135 forks source link

Some confusion of the discriminator input: Should it be cell states sequence or output sequence? #6

Closed haoransh closed 6 years ago

haoransh commented 6 years ago

I have some confusion of your code implementation and I think it might not be consistent with the description in the paper.

in style_transfer.py Line 89

teach_h = tf.concat([tf.expand_dims(self.h_ori, 1), g_outputs], 1)

the 'g_outputs' is the output state sequences since it's returned by 'dynamic_rnn' function. However, in your code nn.py Line106, the h is the cell state of RNN so the h_seq is recording the cell state sequence.

h_seq.append(tf.expand_dims(h, 1))
output, h = cell(inp, h)

However, these two tensors are feed into the discriminator then, despite they are recording different values: one for output states of RNN and one for cell states. While the first timestep of soft_h_tsf and teach_h are both cell states, the following timesteps seem to record different kinds of sequence. I'm afraid the discriminator might just learn to differentiate whether the input is cell states or output states. I think these two sequences should both be cell state sequences to support your ideas in the paper. Is the implementation intended or an implementation bug?

Looking forward to your reply! Thanks!

shentianxiao commented 6 years ago

I'm using GRU cell, so they're the same.

haoransh commented 6 years ago

I see. I had thought it's LSTM cell. Thanks a lot!

NJRBarry commented 5 years ago

And only when the RNN(GRU) has just one layer, they're the same. Right?