25ac33440334fd2fdfe3fe4e4dd3dd1428601a47,examples/pytorch/rgcn/experimental/entity_classify_dist.py,,main,#Any#,438
Before Change
print("//classes:", n_classes)
// these two infor should have a better place to store and retrive
num_of_ntype = len(th.unique(g.ndata[dgl.NTYPE][np.arange(g.number_of_nodes() )]))
num_rels = len(th.unique(g.edata[dgl.ETYPE][np.arange(g.number_of_edges())]))
// no initial node features
After Change
len(val_nid), len(np.intersect1d(val_nid.numpy(), local_nid)),
len(test_nid), len(np.intersect1d(test_nid.numpy(), local_nid))))
device = th.device("cpu")
labels = g .nodes["paper"].data["labels"][np.arange(g.number_of_nodes("paper"))]
all_val_nid = th.LongTensor(np.nonzero(g .nodes["paper"].data["val_mask"][np.arange(g.number_of_nodes("paper"))])).squeeze()
all_test_nid = th.LongTensor(np.nonzero(g.nodes["paper"].data["test_mask"][np.arange(g.number_of_nodes("paper"))])).squeeze()
n_classes = len(th.unique(labels[labels >= 0]))
print("//classes:", n_classes)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: dmlc/dgl
Commit Name: 25ac33440334fd2fdfe3fe4e4dd3dd1428601a47
Time: 2021-01-24
Author: zhengda1936@gmail.com
File Name: examples/pytorch/rgcn/experimental/entity_classify_dist.py
Class Name:
Method Name: main
Project Name: dmlc/dgl
Commit Name: 25ac33440334fd2fdfe3fe4e4dd3dd1428601a47
Time: 2021-01-24
Author: zhengda1936@gmail.com
File Name: examples/pytorch/rgcn/experimental/entity_classify_dist.py
Class Name:
Method Name: main
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: neuroailab/tnn
Commit Name: fde7cc023ea226bf01563d0cbce919e85f8701fd
Time: 2016-10-02
Author: qbilius@gmail.com
File Name: model.py
Class Name:
Method Name: _last