9ea14875825b2ab63a43ad2f0f5159d99df86d02,model.py,Lookahead,forward,#Lookahead#,122

Before Change


        seq_len = input.size(0)
        // pad the 0th dimension (T/sequence) with zeroes whose number = context
        // Once pytorch"s padding functions have settled, should move to those.
        padding = torch.zeros(self.context, *(input.size()[1:])).type_as(input)
        x = torch.cat((input, padding), 0)

        // add lookahead windows (with context+1 width) as a fourth dimension
        // for each seq-batch-feature combination
        x = [x[i:i + self.context + 1] for i in range(seq_len)]  // TxLxNxH - sequence, context, batch, feature
        x = torch.stack(x)
        x = x.permute(0, 2, 3, 1)  // TxNxHxL - sequence, batch, feature, context

After Change


        x = x.transpose(0, 1).transpose(1, 2)
        x = F.pad(x, pad=self.pad, value=0)
        x = self.conv(x)
        x = x.transpose(1, 2).transpose(0, 1).contiguous()
        return x

    def __repr__(self):
        return self.__class__.__name__ + "(" \
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: SeanNaren/deepspeech.pytorch
Commit Name: 9ea14875825b2ab63a43ad2f0f5159d99df86d02
Time: 2019-07-29
Author: rasmus.arpe@gmail.com
File Name: model.py
Class Name: Lookahead
Method Name: forward


Project Name: BVLC/caffe
Commit Name: 32dc03f14c36d1df46f37a7d13ad528e52c6f786
Time: 2015-11-05
Author: matthieu.perrinel@gmail.com
File Name: python/caffe/io.py
Class Name: Transformer
Method Name: deprocess


Project Name: Esri/raster-functions
Commit Name: 1aff9ce62a0c9db7f02b93830fed4073fed49bd1
Time: 2015-02-02
Author: jwasilkowski@esri.com
File Name: functions/LinearSpectralUnmixing.py
Class Name: LinearSpectralUnmixing
Method Name: updatePixels