7c54ef6464c5d2885faf3e8b3ad60451d1894d7a,anago/layers.py,ChainCRF,build,#ChainCRF#Any#,280

Before Change


                                     shape=(None, n_steps, n_classes))]

        self.U = self.add_weight((n_classes, n_classes),
                                 initializer=self.init,
                                 name="U",
                                 regularizer=self.U_regularizer,
                                 constraint=self.U_constraint)

        self.b_start = self.add_weight((n_classes, ),
                                       initializer="zero",
                                       name="b_start",
                                       regularizer=self.b_start_regularizer,
                                       constraint=self.b_start_constraint)

        self.b_end = self.add_weight((n_classes, ),
                                     initializer="zero",
                                     name="b_end",
                                     regularizer=self.b_end_regularizer,
                                     constraint=self.b_end_constraint)

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

        self.built = True

    def call(self, x, mask=None):
        y_pred = viterbi_decode(x, self.U, self.b_start, self.b_end, mask)

After Change


                                      initializer=self.kernel_initializer,
                                      regularizer=self.kernel_regularizer,
                                      constraint=self.kernel_constraint)
        self.chain_kernel = self.add_weight((self.units, self.units),
                                            name="chain_kernel",
                                            initializer=self.chain_initializer,
                                            regularizer=self.chain_regularizer,
                                            constraint=self.chain_constraint)
        if self.use_bias:
            self.bias = self.add_weight((self.units,),
                                        name="bias",
                                        initializer=self.bias_initializer,
                                        regularizer=self.bias_regularizer,
                                        constraint=self.bias_constraint)
        else:
            self.bias = None

        if self.use_boundary:
            self.left_boundary = self.add_weight((self.units,),
                                                 name="left_boundary",
                                                 initializer=self.boundary_initializer,
                                                 regularizer=self.boundary_regularizer,
                                                 constraint=self.boundary_constraint)
            self.right_boundary = self.add_weight((self.units,),
                                                  name="right_boundary",
                                                  initializer=self.boundary_initializer,
                                                  regularizer=self.boundary_regularizer,
                                                  constraint=self.boundary_constraint)
        self.built = True

    def call(self, X, mask=None):
        if mask is not None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 23

Instances


Project Name: Hironsan/anago
Commit Name: 7c54ef6464c5d2885faf3e8b3ad60451d1894d7a
Time: 2018-05-28
Author: hiroki.nakayama.py@gmail.com
File Name: anago/layers.py
Class Name: ChainCRF
Method Name: build


Project Name: Hironsan/anago
Commit Name: 7c54ef6464c5d2885faf3e8b3ad60451d1894d7a
Time: 2018-05-28
Author: hiroki.nakayama.py@gmail.com
File Name: anago/layers.py
Class Name: ChainCRF
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


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