4807d3523ea77a38461d1458fc18749a88814d37,tgen/nn.py,MaxPool1DLayer,connect,#MaxPool1DLayer#Any#,168

Before Change


    def connect(self, inputs):
        // swap dimensions (we are going to max-pool over the sentence/DA, not over embedding
        // dimensions) + pad one more dimension that we won"t use
        input_padded = T.shape_padright(inputs.dimshuffle(1, 0), 1)
        // do the max-pooling
        pooled = downsample.max_pool_2d(input_padded, (self.downscale_factor, 1), self.ignore_border)
        // remove the padded dimension + swap dimensions back
        output = pooled[:, :, 0].dimshuffle(1, 0)
        self.inputs.append(inputs)
        self.outputs.append(output)
        return output

After Change



        self.params = []  // no parameters here

    def connect(self, inputs):
        if self.stride > 1:
            output = T.max(T.reshape(inputs,
                                     (inputs.shape[0] / self.stride,
                                      inputs.shape[1] * self.stride)),
                           axis=0)
        else:
            output = T.max(inputs, axis=0)
        self.inputs.append(inputs)
        self.outputs.append(output)
        return output
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 31

Instances


Project Name: UFAL-DSG/tgen
Commit Name: 4807d3523ea77a38461d1458fc18749a88814d37
Time: 2015-05-27
Author: odusek@ufal.mff.cuni.cz
File Name: tgen/nn.py
Class Name: MaxPool1DLayer
Method Name: connect


Project Name: UFAL-DSG/tgen
Commit Name: 3dfd50e50df50468d7bf74ffb271488adba7be47
Time: 2015-06-08
Author: odusek@ufal.mff.cuni.cz
File Name: tgen/nn.py
Class Name: MaxPool1DLayer
Method Name: connect


Project Name: UFAL-DSG/tgen
Commit Name: 4807d3523ea77a38461d1458fc18749a88814d37
Time: 2015-05-27
Author: odusek@ufal.mff.cuni.cz
File Name: tgen/nn.py
Class Name: MaxPool1DLayer
Method Name: connect


Project Name: UFAL-DSG/tgen
Commit Name: 3bdad2ef150d2dba9edf857cdfcd706d85dab86b
Time: 2015-06-16
Author: odusek@ufal.mff.cuni.cz
File Name: tgen/nn.py
Class Name: MaxPool1DLayer
Method Name: connect