7156c7163b046686064d7c9de445041870e672bc,tutorials/1_first.py,,,#,136

Before Change


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// See the python wrapper:

g_boring = a_boring_graph()
graph_sum = readout(g_boring)
print("graph sum before send() and recv() is: ", graph_sum)
super_useful_comp(g_boring)
graph_sum = readout(g_boring)
print("graph sum after send() and recv() is: ", graph_sum)

g_better = an_interesting_graph()
graph_sum = readout(g_better)

After Change



optimizer = torch.optim.Adam(net.parameters(), lr=0.01)
all_logits = []
for epoch in range(30):
    logits = net(G, inputs)
    // we save the logits for visualization later
    all_logits.append(logits.detach())
    logp = F.log_softmax(logits, 1)
    // we only compute loss for labeled nodes
    loss = F.nll_loss(logp[labeled_nodes], labels)

    optimizer.zero_grad()
    loss.backward()
    optimizer.step()

    print("Epoch %d | Loss: %.4f" % (epoch, loss.item()))

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Since the model produces a 2-dimensional vector for each node, we can
// visualize it very easily.
import matplotlib.animation as animation
import matplotlib.pyplot as plt

def draw(i):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: dmlc/dgl
Commit Name: 7156c7163b046686064d7c9de445041870e672bc
Time: 2018-12-01
Author: minjie.wang@nyu.edu
File Name: tutorials/1_first.py
Class Name:
Method Name:


Project Name: rusty1s/pytorch_geometric
Commit Name: 78667257ffe9c2501791d2d7b143f9d820b2a7ee
Time: 2020-03-23
Author: matthias.fey@tu-dortmund.de
File Name: examples/gnn_explainer.py
Class Name:
Method Name:


Project Name: erikwijmans/Pointnet2_PyTorch
Commit Name: 803d7e1fc61536c846c811bdee158bd21db36779
Time: 2017-12-26
Author: ewijmans2@gmail.com
File Name: models/Pointnet2Cls.py
Class Name:
Method Name:


Project Name: dmlc/dgl
Commit Name: 7156c7163b046686064d7c9de445041870e672bc
Time: 2018-12-01
Author: minjie.wang@nyu.edu
File Name: tutorials/1_first.py
Class Name:
Method Name: