bug fixes to persona seq2seq
@@ -113,7 +113,7 @@ class Seq2seqAgent(Agent):
'be similar in length to one another by throwing '
'away extra tokens. This reduces the total amount '
'of padding in the batches.')
- agent.add_argument('-enc', '--encoder', default='gru',
+ agent.add_argument('-enc', '--encoder', default='lstm',
choices=Seq2seqAgent.ENC_OPTS.keys(),
help='Choose between different encoder modules.')
agent.add_argument('-dec', '--decoder', default='same',
@@ -1047,7 +1047,7 @@ class PersonachatSeqseqAgentSplit(Agent):
'be similar in length to one another by throwing '
'away extra tokens. This reduces the total amount '
'of padding in the batches.')
- agent.add_argument('-enc', '--encoder', default='gru',
+ agent.add_argument('-enc', '--encoder', default='lstm',
choices=Seq2seqAgent.ENC_OPTS.keys(),
help='Choose between different encoder modules.')
agent.add_argument('-dec', '--decoder', default='same',
@@ -1648,6 +1648,7 @@ class PersonachatSeqseqAgentSplit(Agent):
else:
xes = self.lt(xs)
xes = F.dropout(xes, p=2*self.dropout, training=is_training)
+ xes_packed = pack_padded_sequence(xes.transpose(0, 1), x_lens)
if self.zeros.size(1) != batchsize:
self.zeros.resize_(self.num_layers, batchsize, self.hidden_size).fill_(0)
