ff62eb251b04b8301e71aee970bdb157f2649fa9,keras/layers/core.py,MaxoutDense,build,#MaxoutDense#Any#,895

Before Change


        self.input_spec = [InputSpec(dtype=K.floatx(),
                                     shape=(None, input_dim))]

        self.W = self.init((self.nb_feature, input_dim, self.output_dim),
                           name="{}_W".format(self.name))
        if self.bias:
            self.b = K.zeros((self.nb_feature, self.output_dim),
                             name="{}_b".format(self.name))
            self.trainable_weights = [self.W, self.b]
        else:
            self.trainable_weights = [self.W]

        self.regularizers = []
        if self.W_regularizer:
            self.W_regularizer.set_param(self.W)
            self.regularizers.append(self.W_regularizer)

        if self.bias and self.b_regularizer:
            self.b_regularizer.set_param(self.b)
            self.regularizers.append(self.b_regularizer)

        if self.activity_regularizer:
            self.activity_regularizer.set_layer(self)
            self.regularizers.append(self.activity_regularizer)

        self.constraints = {}
        if self.W_constraint:
            self.constraints[self.W] = self.W_constraint
        if self.bias and self.b_constraint:
            self.constraints[self.b] = self.b_constraint

        if self.initial_weights is not None:
            self.set_weights(self.initial_weights)
            del self.initial_weights

After Change


            kwargs["input_shape"] = (self.input_dim,)
        super(MaxoutDense, self).__init__(**kwargs)

    def build(self, input_shape):
        input_dim = input_shape[1]
        self.input_spec = [InputSpec(dtype=K.floatx(),
                                     shape=(None, input_dim))]

        self.W = self.add_weight((self.nb_feature, input_dim, self.output_dim),
                                 initializer=self.init,
                                 name="{}_W".format(self.name),
                                 regularizer=self.W_regularizer,
                                 constraint=self.W_constraint)
        if self.bias:
            self.b = self.add_weight((self.nb_feature, self.output_dim,),
                                     initializer="zero",
                                     name="{}_b".format(self.name),
                                     regularizer=self.b_regularizer,
                                     constraint=self.b_constraint)
        else:
            self.b = None

        if self.initial_weights is not None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 64

Instances


Project Name: keras-team/keras
Commit Name: ff62eb251b04b8301e71aee970bdb157f2649fa9
Time: 2016-12-14
Author: francois.chollet@gmail.com
File Name: keras/layers/core.py
Class Name: MaxoutDense
Method Name: build


Project Name: keras-team/keras
Commit Name: ff62eb251b04b8301e71aee970bdb157f2649fa9
Time: 2016-12-14
Author: francois.chollet@gmail.com
File Name: keras/layers/core.py
Class Name: MaxoutDense
Method Name: build


Project Name: keras-team/keras
Commit Name: ff62eb251b04b8301e71aee970bdb157f2649fa9
Time: 2016-12-14
Author: francois.chollet@gmail.com
File Name: keras/layers/convolutional.py
Class Name: Convolution1D
Method Name: build


Project Name: keras-team/keras
Commit Name: ff62eb251b04b8301e71aee970bdb157f2649fa9
Time: 2016-12-14
Author: francois.chollet@gmail.com
File Name: keras/layers/local.py
Class Name: LocallyConnected1D
Method Name: build