MCPcopy Index your code
hub / github.com/PyGCL/PyGCL / test

Function test

examples/DGI_inductive.py:69–80  ·  view source on GitHub ↗
(encoder_model, data, dataloader)

Source from the content-addressed store, hash-verified

67
68
69def test(encoder_model, data, dataloader):
70 encoder_model.eval()
71 zs = []
72 for i, (batch_size, node_id, adjs) in enumerate(dataloader):
73 adjs = [adj.to('cuda') for adj in adjs]
74 z, _, _ = encoder_model(data.x[node_id], adjs)
75 zs.append(z)
76 x = torch.cat(zs, dim=0)
77
78 split = get_split(num_samples=x.size()[0], train_ratio=0.1, test_ratio=0.8)
79 result = LREvaluator()(x, data.y, split)
80 return result
81
82
83def main():

Callers 1

mainFunction · 0.70

Calls 2

get_splitFunction · 0.90
LREvaluatorClass · 0.90

Tested by

no test coverage detected