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

Before Change


            combination_slices = tf.unstack(K.reshape(combinations, (B, -1, 2 * self.F_)))
            output_features = []
            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


        X = inputs[0]  // input graph (B x F)
        G = inputs[1]  // full graph (N x F) (this is necessary in code, but not in theory. Check section 2.2 of the paper)
        B = K.shape(X)[0]  // Get batch size at runtime
        N = K.shape(G)[0]  // Get number of nodes in the graph at runtime

        outputs = []  // Will store the outputs of each attention head (B x F" or B x KF")
        for head in range(self.attention_heads):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

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: interactiveaudiolab/nussl
Commit Name: 657f91e2b73f8e0a0661784a93310ae8704fe2ec
Time: 2017-01-16
Author: eth@nmanilow.com
File Name: nussl/repet.py
Class Name: Repet
Method Name: _compute_repeating_mask


Project Name: theislab/scanpy
Commit Name: d6acc5e620a5c566b3421b1c8bf2a66a064ca5bd
Time: 2018-10-25
Author: 31883718+VolkerBergen@users.noreply.github.com
File Name: scanpy/preprocessing/simple.py
Class Name:
Method Name: normalize_per_cell_weinreb16_deprecated


Project Name: broadinstitute/keras-rcnn
Commit Name: 637ecf5877bbd6647caef2bd64925e66a586fb29
Time: 2018-01-30
Author: allen.goodman@icloud.com
File Name: keras_rcnn/layers/losses/__init__.py
Class Name: RCNN
Method Name: regression_loss