cffa4034f580e33fe4295e9f1b54217e7fa724eb,examples/pytorch/gcn/gcn.py,GCN,forward,#GCN#Any#,66

Before Change


        self.layers.append(NodeApplyModule(n_hidden, n_classes))

    def forward(self, features):
        self.g.ndata["h"] = features

        for idx, layer in enumerate(self.layers):
            // apply dropout
            if idx > 0 and self.dropout:
                self.g.ndata["h"] = self.dropout(self.g.ndata["h"])
            // normalization by square root of src degree
            self.g.ndata["h"] = self.g.ndata["h"] * self.g.ndata["norm"]
            self.g.update_all(gcn_msg, gcn_reduce, layer)
        return self.g.ndata.pop("h")

def evaluate(model, features, labels, mask):
    model.eval()

After Change



    def forward(self, features):
        h = features
        for layer in self.layers:
            h = layer(h)
        return h

def evaluate(model, features, labels, mask):
    model.eval()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: dmlc/dgl
Commit Name: cffa4034f580e33fe4295e9f1b54217e7fa724eb
Time: 2018-12-16
Author: zyhuang94@gmail.com
File Name: examples/pytorch/gcn/gcn.py
Class Name: GCN
Method Name: forward


Project Name: dmlc/dgl
Commit Name: 6f4898a128ebc5227e312640508629b50b32571b
Time: 2018-12-02
Author: yma@yma.io
File Name: examples/mxnet/gcn/gcn_batch.py
Class Name: GCN
Method Name: forward


Project Name: dmlc/dgl
Commit Name: f35ac5443e5028bd677d844cb1e7d724c4d41900
Time: 2018-12-16
Author: minjie.wang@nyu.edu
File Name: examples/pytorch/gcn/gcn_spmv.py
Class Name: GCN
Method Name: forward