9d56361641a64ff73ac630812ecd4964eedbc7aa,gat/graph_attention_layer.py,GraphAttention,call,#GraphAttention#Any#,72

Before Change


            for slice in combination_slices:
                dense = Dense(1)(slice)  // N x 1 (basically "a(Wh_i, Wh_j)" in the paper)
                // TODO: masking
                e_i = K.reshape(dense, (1, -1))  // 1 x N (e_i in the paper)
                softmax = K.squeeze(K.softmax(e_i))  // N (alpha_i in the paper)
                softmax_broadcast = K.transpose(K.reshape(K.tile(softmax, [self.F_]), [self.F_, -1]))
                node_features = K.sum(softmax_broadcast * linear_transf, axis=0)
                if self.use_bias:
                    output = K.bias_add(node_features, self.bias)
                if self.heads_combination == "concat" and self.activation is not None:

After Change


        outputs = []  // Will store the outputs of each attention head (B x F" or B x KF")
        for head in range(self.attention_heads):
            kernel = self.kernels[head]  // W in the paper (F x F")
            attention_kernel = self.attention_kernels[head]  // Attention network a in paper (2*F" x 1)

            // Compute inputs to attention network
            linear_transf_X = K.dot(X, kernel)  // B x F"
            linear_transf_G = K.dot(G, kernel)  // N x F"

            // Repeat feature vectors of input: [[1], [2]] becomes [[1], [1], [2], [2]]
            repeated = K.reshape(K.tile(linear_transf_X, [1, N]), (-1, self.F_))  // B*N x F"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: danielegrattarola/keras-gat
Commit Name: 9d56361641a64ff73ac630812ecd4964eedbc7aa
Time: 2017-11-09
Author: daniele.grattarola@gmail.com
File Name: gat/graph_attention_layer.py
Class Name: GraphAttention
Method Name: call


Project Name: geomstats/geomstats
Commit Name: 2e296adb05f62e4821c36b6f42b1470bdb10eaa6
Time: 2018-02-05
Author: ninamio78@gmail.com
File Name: geomstats/special_euclidean_group.py
Class Name: SpecialEuclideanGroup
Method Name: compose


Project Name: geomstats/geomstats
Commit Name: 16d562f2d1a8df49fde1a2374c5e634a7400fd08
Time: 2018-02-04
Author: ninamio78@gmail.com
File Name: geomstats/special_euclidean_group.py
Class Name: SpecialEuclideanGroup
Method Name: group_exponential_barycenter