b118cef26fae748d5ec23c33b29e9989a7abbe17,keras/layers/advanced_activations.py,PReLU,build,#PReLU#Any#,85

Before Change


                self.param_broadcast[i - 1] = True

        self.alphas = self.init(param_shape,
                                name="{}_alphas".format(self.name))
        self.trainable_weights = [self.alphas]

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

    def call(self, x, mask=None):
        pos = K.relu(x)
        if K.backend() == "theano":
            neg = (K.pattern_broadcast(self.alphas, self.param_broadcast) *

After Change


        else:
            self.shared_axes = list(shared_axes)

    def build(self, input_shape):
        param_shape = list(input_shape[1:])
        self.param_broadcast = [False] * len(param_shape)
        if self.shared_axes[0] is not None:
            for i in self.shared_axes:
                param_shape[i - 1] = 1
                self.param_broadcast[i - 1] = True
        self.alpha = self.add_weight(param_shape,
                                     name="alpha",
                                     initializer=self.alpha_initializer,
                                     regularizer=self.alpha_regularizer,
                                     constraint=self.alpha_constraint)

    def call(self, x, mask=None):
        pos = K.relu(x)
        if K.backend() == "theano":
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 14

Instances


Project Name: keras-team/keras
Commit Name: b118cef26fae748d5ec23c33b29e9989a7abbe17
Time: 2017-02-10
Author: francois.chollet@gmail.com
File Name: keras/layers/advanced_activations.py
Class Name: PReLU
Method Name: build


Project Name: keras-team/keras
Commit Name: 03a7eb89e27b70f2ca0ac932ef4bace7569d6fab
Time: 2017-02-13
Author: francois.chollet@gmail.com
File Name: keras/layers/recurrent.py
Class Name: SimpleRNN
Method Name: build


Project Name: keras-team/keras
Commit Name: b118cef26fae748d5ec23c33b29e9989a7abbe17
Time: 2017-02-10
Author: francois.chollet@gmail.com
File Name: keras/layers/advanced_activations.py
Class Name: PReLU
Method Name: build


Project Name: keras-team/keras
Commit Name: 023331ec2a7b0086abfc81eca16c84a1692ee653
Time: 2017-02-09
Author: francois.chollet@gmail.com
File Name: keras/layers/convolutional.py
Class Name: Convolution2D
Method Name: build