8fae3aef46180186d420db3ec88fc747261f0d5c,models/ShowTellModel.py,ShowTellModel,_sample,#ShowTellModel#Any#Any#Any#Any#,120

Before Change


            output, state = self.core(xt.unsqueeze(0), state)
            logprobs = F.log_softmax(self.logit(self.dropout(output.squeeze(0))), dim=1)

        return torch.cat([_.unsqueeze(1) for _ in seq], 1), torch.cat([_.unsqueeze(1) for _ in seqLogprobs], 1)

After Change


        batch_size = fc_feats.size(0)
        state = self.init_hidden(batch_size)
        seq = fc_feats.new_zeros(batch_size, self.seq_length, dtype=torch.long)
        seqLogprobs = fc_feats.new_zeros(batch_size, self.seq_length)
        for t in range(self.seq_length + 2):
            if t == 0:
                xt = self.img_embed(fc_feats)
            else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: ruotianluo/self-critical.pytorch
Commit Name: 8fae3aef46180186d420db3ec88fc747261f0d5c
Time: 2018-05-30
Author: rluo@ttic.edu
File Name: models/ShowTellModel.py
Class Name: ShowTellModel
Method Name: _sample


Project Name: stanfordnlp/stanza
Commit Name: a74b6127e6f83e0bc11f8c6c1dfc60bc2c6e0983
Time: 2018-09-14
Author: qipeng@users.noreply.github.com
File Name: models/common/packed_lstm.py
Class Name: LSTMwRecDropout
Method Name: forward