shentianxiao / language-style-transfer

Apache License 2.0
553 stars 135 forks source link

Inference mix-up #8

Closed rpryzant closed 6 years ago

rpryzant commented 6 years ago

Thanks for putting your code online! Super clean.

I'm a little confused about decoding, in particular how you decide which decodings are domain0 and which are domain1 over the dev set.

The decodings are unpacked here:

        data0_tsf += tsf[:half]
        data1_tsf += tsf[half:]

tsf comes from self.hard_logits_tsf, defined here:

        hard_h_tsf, self.hard_logits_tsf = rnn_decode(self.h_tsf, go, max_len,
            cell_g, hard_func, scope='generator')

My understanding is that dimension 0 of self.hard_logits_tsf is structured as follows:

[ logits for 0 examples transferred to 1  |  logits for 1 examples transferred to 0]

So coming back to the decodings, the first half of tsf is d0=>d1, and the second half is d1=>d0.

So shouldn't tsf[:half] be holding data for data1_tsf and not the other way around?

rpryzant commented 6 years ago

Closing, seems like that's totally the intended behavior.