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

Optimizing generate_soft_embed() and sample_soft_embed() #19

Closed nabihach closed 6 years ago

nabihach commented 6 years ago

I'm wondering how to optimize the functions generate_soft_embed() and sample_soft_embed() in model.py. Right now, we loop over the mini-batch sequentially, which is extremely slow. On the other hand, there doesn't seem to be an intuitive way to parallelize this. Any ideas?

nabihach commented 6 years ago

I was able to do this on my own. Closing the issue.