ChenChengKuan / SeqGAN_tensorflow

SeqGAN tensorflow implementation
MIT License
106 stars 37 forks source link

如果要生成长度不都一样的序列怎么办? #3

Closed chenzk1993 closed 9 months ago

chenzk1993 commented 6 years ago

比如我要用实际的新闻语料作为positive example,但新闻中的每句话长度不可能一样,此时应该把短的语句填充到和最长的长度一样吗?

ChenChengKuan commented 6 years ago

对 最简单的方法就是padding 然后你在rollout时算出的reward 记得在padding的位置要加一个mask过滤掉

chenzk1993 commented 6 years ago

好的,非常感谢!

winnechan commented 5 years ago

positive example也不会参与到generator中,好像和rollout的reward没有关系,因为reward是根据生成的句子来计算的。然后,generator生成的句子是没有ground truth的,reward是算到end token那里后面的就mask掉么?