927d2b319bc7a6c31c63ad64e6124477c2a5b583,examples/pytorch/ogb/ogbn-products/graphsage/main.py,SAGE,inference,#SAGE#Any#Any#Any#Any#,56

Before Change


        // Therefore, we compute the representation of all nodes layer by layer.  The nodes
        // on each layer are of course splitted in batches.
        // TODO: can we standardize this?
        nodes = th.arange(g.number_of_nodes())
        for l, layer in enumerate(self.layers):
            y = th.zeros(g.number_of_nodes(), self.n_hidden if l != len(self.layers) - 1 else self.n_classes)

After Change


    
    return (th.argmax(pred, dim=1) == labels).float().sum() / len(pred)

def evaluate(model, g, nfeat, labels, val_nid, test_nid, device):
    
    Evaluate the model on the validation set specified by ``val_mask``.
    g : The entire graph.
    inputs : The features of all the nodes.
    labels : The labels of all the nodes.
    val_mask : A 0-1 mask indicating which nodes do we actually compute the accuracy for.
    device : The GPU device to evaluate on.
    
    model.eval()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: dmlc/dgl
Commit Name: 927d2b319bc7a6c31c63ad64e6124477c2a5b583
Time: 2020-12-28
Author: mufeili1996@gmail.com
File Name: examples/pytorch/ogb/ogbn-products/graphsage/main.py
Class Name: SAGE
Method Name: inference


Project Name: neuroailab/tnn
Commit Name: fde7cc023ea226bf01563d0cbce919e85f8701fd
Time: 2016-10-02
Author: qbilius@gmail.com
File Name: model.py
Class Name:
Method Name: _last


Project Name: neuroailab/tnn
Commit Name: fde7cc023ea226bf01563d0cbce919e85f8701fd
Time: 2016-10-02
Author: qbilius@gmail.com
File Name: model.py
Class Name:
Method Name: _first


Project Name: dmlc/dgl
Commit Name: 61fa3c6cf5441e6dd34e3d51e5f519308e5a1baf
Time: 2018-09-01
Author: minjie.wang@nyu.edu
File Name: examples/pytorch/tree_lstm/train.py
Class Name:
Method Name: main