94d857f3cbbc668fbf9eb641895454612c5f124a,keras/layers/core.py,MaxoutDense,__init__,#MaxoutDense#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,505

Before Change


        if b_regularizer:
            b_regularizer.set_param(self.b)
            self.regularizers.append(b_regularizer)
        if activity_regularizer:
            activity_regularizer.set_layer(self)
            self.regularizers.append(activity_regularizer)

        self.constraints = [W_constraint, b_constraint]

        if weights is not None:
            self.set_weights(weights)

After Change


        Max-out layer, nb_feature is the number of pieces in the piecewise linear approx.
        Refer to http://arxiv.org/pdf/1302.4389.pdf
    """
    def __init__(self, input_dim, output_dim, nb_feature=4, init="glorot_uniform", weights=None, 
        W_regularizer="identity", b_regularizer="identity", activity_regularizer="identity", W_constraint="identity", b_constraint="identity"):

        super(MaxoutDense, self).__init__()
        self.init = initializations.get(init)
        self.input_dim = input_dim
        self.output_dim = output_dim
        self.nb_feature = nb_feature

        self.input = T.matrix()
        self.W = self.init((self.nb_feature, self.input_dim, self.output_dim))
        self.b = shared_zeros((self.nb_feature, self.output_dim))

        self.params = [self.W, self.b]

        self.regularizers = []

        self.W_regularizer = regularizers.get(W_regularizer)
        self.W_regularizer.set_param(self.W)
        self.regularizers.append(self.W_regularizer)

        self.b_regularizer = regularizers.get(b_regularizer)
        self.b_regularizer.set_param(self.b)
        self.regularizers.append(self.b_regularizer)

        self.activity_regularizer = regularizers.get(activity_regularizer)
        self.activity_regularizer.set_layer(self)
        self.regularizers.append(self.activity_regularizer)

        self.W_constraint = constraints.get(W_constraint)
        self.b_constraint = constraints.get(b_constraint)
        self.constraints = [self.W_constraint, self.b_constraint]

        if weights is not None:
            self.set_weights(weights)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 37

Instances


Project Name: keras-team/keras
Commit Name: 94d857f3cbbc668fbf9eb641895454612c5f124a
Time: 2015-07-09
Author: max.pumperla@numberfour.eu
File Name: keras/layers/core.py
Class Name: MaxoutDense
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 94d857f3cbbc668fbf9eb641895454612c5f124a
Time: 2015-07-09
Author: max.pumperla@numberfour.eu
File Name: keras/layers/convolutional.py
Class Name: Convolution2D
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 94d857f3cbbc668fbf9eb641895454612c5f124a
Time: 2015-07-09
Author: max.pumperla@numberfour.eu
File Name: keras/layers/core.py
Class Name: MaxoutDense
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 94d857f3cbbc668fbf9eb641895454612c5f124a
Time: 2015-07-09
Author: max.pumperla@numberfour.eu
File Name: keras/layers/core.py
Class Name: TimeDistributedDense
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 94d857f3cbbc668fbf9eb641895454612c5f124a
Time: 2015-07-09
Author: max.pumperla@numberfour.eu
File Name: keras/layers/core.py
Class Name: Dense
Method Name: __init__


Project Name: keras-team/keras
Commit Name: 94d857f3cbbc668fbf9eb641895454612c5f124a
Time: 2015-07-09
Author: max.pumperla@numberfour.eu
File Name: keras/layers/convolutional.py
Class Name: Convolution1D
Method Name: __init__