26421ce20c6b626ceacafbb3282cad1d5dce04ca,onmt/Models.py,Embeddings,forward,#Embeddings#Any#,60

Before Change


        emb = word
        if self.feature_dicts:
            features = [feature_lut(src_input[:, :, j+1])
                        for j, feature_lut in enumerate(self.feature_luts)]

            // Apply one MLP layer.
            emb = self.activation(
                self.linear(torch.cat([word] + features, -1)))

        if self.positional_encoding:
            emb = emb + Variable(self.pe[:emb.size(0), :1, :emb.size(2)]
                                 .expand_as(emb))
            emb = self.dropout(emb)
        return emb


class Encoder(nn.Module):

After Change


        Return:
            emb (FloatTensor): len x batch x sum of feature embedding sizes
        
        feat_inputs = (feat.squeeze(2) for feat in src_input.split(1, dim=2))
        features = [lut(feat) for lut, feat in zip(self.emb_luts, feat_inputs)]
        emb = self.merge(features)
        return emb
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 26421ce20c6b626ceacafbb3282cad1d5dce04ca
Time: 2017-07-30
Author: bpeters@coli.uni-saarland.de
File Name: onmt/Models.py
Class Name: Embeddings
Method Name: forward


Project Name: HyperGAN/HyperGAN
Commit Name: d3db5f4c25b0872bb52d4ddf3b32487517973267
Time: 2016-10-21
Author: martyn@255bits.com
File Name: shared/gan.py
Class Name:
Method Name: discriminator_pyramid


Project Name: HyperGAN/HyperGAN
Commit Name: 9010d90576d8da39f8c3be180cbccd0d1663f7c2
Time: 2017-01-29
Author: martyn@255bits.com
File Name: hypergan/discriminators/pyramid_nostride_discriminator.py
Class Name:
Method Name: discriminator