Unverified Commit 158b0fcd authored by Andrei Ivanov's avatar Andrei Ivanov Committed by GitHub
Browse files

Improving the citation_network example. (#6032)

parent 61b2f4e2
......@@ -61,7 +61,7 @@ def main(args):
val_mask = g.ndata["val_mask"]
test_mask = g.ndata["test_mask"]
in_feats = features.shape[1]
n_classes = data.num_labels
n_classes = data.num_classes
n_edges = g.num_edges()
print(
"""----Data statistics------'
......@@ -108,7 +108,7 @@ def main(args):
)
# initialize graph
dur = []
mean = 0
for epoch in range(200):
model.train()
if epoch >= 3:
......@@ -122,17 +122,16 @@ def main(args):
optimizer.step()
if epoch >= 3:
dur.append(time.time() - t0)
mean = (mean * (epoch - 3) + (time.time() - t0)) / (epoch - 2)
acc = evaluate(model, features, labels, val_mask)
print(
"Epoch {:05d} | Time(s) {:.4f} | Loss {:.4f} | Accuracy {:.4f} | "
"ETputs(KTEPS) {:.2f}".format(
epoch,
np.mean(dur),
mean,
loss.item(),
acc,
n_edges / np.mean(dur) / 1000,
n_edges / mean / 1000,
)
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment