"...pytorch/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "cda8b38101e01b37ceb42b30d3fc3bdce02c78e8"
Unverified Commit 53ea03ad authored by Lingfan Yu's avatar Lingfan Yu Committed by GitHub
Browse files

[Doc] Fix doc bug and warning (#213)

* fix dgmg tutorial indentation

* bug in incidence_matrix docstring

* remove print
parent 0f121eeb
...@@ -1511,17 +1511,23 @@ class DGLGraph(object): ...@@ -1511,17 +1511,23 @@ class DGLGraph(object):
value indicating whether the edge is incident to the node value indicating whether the edge is incident to the node
or not. or not.
There are three types of an incidence matrix `I`: There are three types of an incidence matrix :math:`I`:
* "in": * "in":
- I[v, e] = 1 if e is the in-edge of v (or v is the dst node of e);
- I[v, e] = 0 otherwise. - :math:`I[v, e] = 1` if e is the in-edge of v (or v is the dst node of e);
- :math:`I[v, e] = 0` otherwise.
* "out": * "out":
- I[v, e] = 1 if e is the out-edge of v (or v is the src node of e);
- I[v, e] = 0 otherwise. - :math:`I[v, e] = 1` if e is the out-edge of v (or v is the src node of e);
- :math:`I[v, e] = 0` otherwise.
* "both": * "both":
- I[v, e] = 1 if e is the in-edge of v;
- I[v, e] = -1 if e is the out-edge of v; - :math:`I[v, e] = 1` if e is the in-edge of v;
- I[v, e] = 0 otherwise (including self-loop). - :math:`I[v, e] = -1` if e is the out-edge of v;
- :math:`I[v, e] = 0` otherwise (including self-loop).
Parameters Parameters
---------- ----------
......
...@@ -336,10 +336,8 @@ model.train() ...@@ -336,10 +336,8 @@ model.train()
for epoch in range(n_epochs): for epoch in range(n_epochs):
optimizer.zero_grad() optimizer.zero_grad()
logits = model.forward(g) logits = model.forward(g)
print("after forward")
loss = F.cross_entropy(logits[train_idx], labels[train_idx]) loss = F.cross_entropy(logits[train_idx], labels[train_idx])
loss.backward() loss.backward()
print("after backward")
optimizer.step() optimizer.step()
......
...@@ -55,9 +55,10 @@ g.add_edges([2, 0], [0, 2]) # Add edges (2, 0), (0, 2) ...@@ -55,9 +55,10 @@ g.add_edges([2, 0], [0, 2]) # Add edges (2, 0), (0, 2)
# with different sizes, topologies, node types, edge types, and the possibility # with different sizes, topologies, node types, edge types, and the possibility
# of multigraphs. Besides, a same graph can be generated in many different # of multigraphs. Besides, a same graph can be generated in many different
# orders. Regardless, the generative process entails a few steps: # orders. Regardless, the generative process entails a few steps:
# - Encode a changing graph, #
# - Perform actions stochastically, # - Encode a changing graph,
# - Collect error signals and optimize the model parameters (If we are training) # - Perform actions stochastically,
# - Collect error signals and optimize the model parameters (If we are training)
# #
# When it comes to implementation, another important aspect is speed: how do we # When it comes to implementation, another important aspect is speed: how do we
# parallelize the computation given that generating a graph is fundamentally a # parallelize the computation given that generating a graph is fundamentally a
......
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