wiseodd / controlled-text-generation

Reproducing Hu, et. al., ICML 2017's "Toward Controlled Generation of Text"
BSD 3-Clause "New" or "Revised" License
242 stars 63 forks source link

A wee question #11

Closed XinnuoXu closed 6 years ago

XinnuoXu commented 6 years ago

Why shouldn't the "labels" here be the "c" sampled in model.generate_sentences(batch_size) (line 87)?

https://github.com/wiseodd/controlled-text-generation/blob/a09ad1d9272b9e40fc0084ad1779a6d44f07862d/train_discriminator.py#L96

wiseodd commented 6 years ago

I've looked back at the paper (Eq. 10) and I think you are correct. generate_sentences() in model should also output c ~ p(c), and we use it in line 96 of train_discriminator.py.

I don't have time to revise and test this though. Would you mind to submit a pull request for this?

XinnuoXu commented 6 years ago

Yeah, sure : )

TobiasLee commented 6 years ago

I've submited a PR to solve this problem #16

wiseodd commented 6 years ago

Thanks very much @TobiasLee! However (maybe you already aware), I think we need to store and return c instead of z.

Much appreciated for the PR!