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

Before Change


                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"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

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: interactiveaudiolab/nussl
Commit Name: 2ffbfa3a6bd3b8de8e21a762489346054dcd9ccc
Time: 2020-03-12
Author: prem@u.northwestern.edu
File Name: nussl/separation/deep/deep_mask_estimation.py
Class Name: DeepMaskEstimation
Method Name: extract_features


Project Name: rusty1s/pytorch_geometric
Commit Name: 7be56405f2af0f700763249da3c368976582d792
Time: 2020-12-07
Author: matthias.fey@tu-dortmund.de
File Name: examples/tgn.py
Class Name: GraphAttentionEmbedding
Method Name: forward


Project Name: hunkim/PyTorchZeroToAll
Commit Name: 55b880469ced115de9949d5d25ff835dabbb2caa
Time: 2017-11-08
Author: hunkim@gmail.com
File Name: 12_2_hello_rnn.py
Class Name:
Method Name: