Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
c23a61bd
Unverified
Commit
c23a61bd
authored
Mar 04, 2020
by
Jinjing Zhou
Committed by
GitHub
Mar 04, 2020
Browse files
fix s3 link (#1310)
parent
349a48bd
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
51 additions
and
51 deletions
+51
-51
apps/kg/README.md
apps/kg/README.md
+5
-5
apps/kg/dataloader/KGDataset.py
apps/kg/dataloader/KGDataset.py
+2
-2
docker/README.md
docker/README.md
+2
-2
examples/pytorch/graphwriter/README.md
examples/pytorch/graphwriter/README.md
+2
-2
examples/pytorch/graphwriter/prepare_data.sh
examples/pytorch/graphwriter/prepare_data.sh
+1
-1
examples/pytorch/metapath2vec/download.py
examples/pytorch/metapath2vec/download.py
+1
-1
examples/pytorch/model_zoo/chem/generative_models/dgmg/README.md
...s/pytorch/model_zoo/chem/generative_models/dgmg/README.md
+2
-2
examples/pytorch/model_zoo/chem/property_prediction/README.md
...ples/pytorch/model_zoo/chem/property_prediction/README.md
+2
-2
examples/pytorch/pointcloud/main.py
examples/pytorch/pointcloud/main.py
+1
-1
examples/pytorch/recommendation/README.md
examples/pytorch/recommendation/README.md
+1
-1
examples/pytorch/rrn/sudoku_data.py
examples/pytorch/rrn/sudoku_data.py
+1
-1
examples/pytorch/rrn/sudoku_solver.py
examples/pytorch/rrn/sudoku_solver.py
+1
-1
examples/pytorch/transformer/dataset/utils.py
examples/pytorch/transformer/dataset/utils.py
+2
-2
python/dgl/contrib/sampling/sampler.py
python/dgl/contrib/sampling/sampler.py
+1
-1
python/dgl/nodeflow.py
python/dgl/nodeflow.py
+1
-1
tutorials/basics/1_first.py
tutorials/basics/1_first.py
+4
-4
tutorials/basics/4_batch.py
tutorials/basics/4_batch.py
+6
-6
tutorials/basics/5_hetero.py
tutorials/basics/5_hetero.py
+4
-4
tutorials/models/1_gnn/8_sse_mx.py
tutorials/models/1_gnn/8_sse_mx.py
+3
-3
tutorials/models/1_gnn/9_gat.py
tutorials/models/1_gnn/9_gat.py
+9
-9
No files found.
apps/kg/README.md
View file @
c23a61bd
...
@@ -48,11 +48,11 @@ DGL-KE provides five knowledge graphs:
...
@@ -48,11 +48,11 @@ DGL-KE provides five knowledge graphs:
| Dataset | #nodes | #edges | #relations |
| Dataset | #nodes | #edges | #relations |
|---------|--------|--------|------------|
|---------|--------|--------|------------|
|
[
FB15k
](
https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/FB15k.zip
)
| 14951 | 592213 | 1345 |
|
[
FB15k
](
https://
data.
dgl.ai/dataset/FB15k.zip
)
| 14951 | 592213 | 1345 |
|
[
FB15k-237
](
https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/FB15k-237.zip
)
| 14541 | 310116 | 237 |
|
[
FB15k-237
](
https://
data.
dgl.ai/dataset/FB15k-237.zip
)
| 14541 | 310116 | 237 |
|
[
wn18
](
https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/wn18.zip
)
| 40943 | 151442 | 18 |
|
[
wn18
](
https://
data.
dgl.ai/dataset/wn18.zip
)
| 40943 | 151442 | 18 |
|
[
wn18rr
](
https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/wn18rr.zip
)
| 40943 | 93003 | 11 |
|
[
wn18rr
](
https://
data.
dgl.ai/dataset/wn18rr.zip
)
| 40943 | 93003 | 11 |
|
[
Freebase
](
https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/Freebase.zip
)
| 86054151 | 338586276 | 14824 |
|
[
Freebase
](
https://
data.
dgl.ai/dataset/Freebase.zip
)
| 86054151 | 338586276 | 14824 |
Users can specify one of the datasets with
`--dataset`
in
`train.py`
and
`eval.py`
.
Users can specify one of the datasets with
`--dataset`
in
`train.py`
and
`eval.py`
.
...
...
apps/kg/dataloader/KGDataset.py
View file @
c23a61bd
...
@@ -38,7 +38,7 @@ class KGDataset1:
...
@@ -38,7 +38,7 @@ class KGDataset1:
The triples are stored as 'head_name
\t
relation_name
\t
tail_name'.
The triples are stored as 'head_name
\t
relation_name
\t
tail_name'.
'''
'''
def
__init__
(
self
,
path
,
name
,
read_triple
=
True
,
only_train
=
False
):
def
__init__
(
self
,
path
,
name
,
read_triple
=
True
,
only_train
=
False
):
url
=
'https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/{}.zip'
.
format
(
name
)
url
=
'https://
data.
dgl.ai/dataset/{}.zip'
.
format
(
name
)
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
name
)):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
name
)):
print
(
'File not found. Downloading from'
,
url
)
print
(
'File not found. Downloading from'
,
url
)
...
@@ -105,7 +105,7 @@ class KGDataset2:
...
@@ -105,7 +105,7 @@ class KGDataset2:
The triples are stored as 'head_nid
\t
relation_id
\t
tail_nid'.
The triples are stored as 'head_nid
\t
relation_id
\t
tail_nid'.
'''
'''
def
__init__
(
self
,
path
,
name
,
read_triple
=
True
,
only_train
=
False
):
def
__init__
(
self
,
path
,
name
,
read_triple
=
True
,
only_train
=
False
):
url
=
'https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/{}.zip'
.
format
(
name
)
url
=
'https://
data.
dgl.ai/dataset/{}.zip'
.
format
(
name
)
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
name
)):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
name
)):
print
(
'File not found. Downloading from'
,
url
)
print
(
'File not found. Downloading from'
,
url
)
...
...
docker/README.md
View file @
c23a61bd
...
@@ -17,12 +17,12 @@ docker build -t dgl-lint -f Dockerfile.ci_lint .
...
@@ -17,12 +17,12 @@ docker build -t dgl-lint -f Dockerfile.ci_lint .
### CPU image for kg
### CPU image for kg
```
bash
```
bash
wget https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/FB15k.zip
-P
install
/
wget https://
data.
dgl.ai/dataset/FB15k.zip
-P
install
/
docker build
-t
dgl-cpu:torch-1.2.0
-f
Dockerfile.ci_cpu_torch_1.2.0 .
docker build
-t
dgl-cpu:torch-1.2.0
-f
Dockerfile.ci_cpu_torch_1.2.0 .
```
```
### GPU image for kg
### GPU image for kg
```
bash
```
bash
wget https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/FB15k.zip
-P
install
/
wget https://
data.
dgl.ai/dataset/FB15k.zip
-P
install
/
docker build
-t
dgl-gpu:torch-1.2.0
-f
Dockerfile.ci_gpu_torch_1.2.0 .
docker build
-t
dgl-gpu:torch-1.2.0
-f
Dockerfile.ci_gpu_torch_1.2.0 .
```
```
examples/pytorch/graphwriter/README.md
View file @
c23a61bd
...
@@ -39,6 +39,6 @@ We repeat the experiment five times.
...
@@ -39,6 +39,6 @@ We repeat the experiment five times.
### Examples
### Examples
We also provide the output of our implementation on test set together with the reference text.
We also provide the output of our implementation on test set together with the reference text.
-
[
GraphWriter's output
](
https://
s3.us-east-2.amazonaws.com/
dgl.ai/models/graphwriter/tmp_pred.txt
)
-
[
GraphWriter's output
](
https://
data.
dgl.ai/models/graphwriter/tmp_pred.txt
)
-
[
Reference text
](
https://
s3.us-east-2.amazonaws.com/
dgl.ai/models/graphwriter/tmp_gold.txt
)
-
[
Reference text
](
https://
data.
dgl.ai/models/graphwriter/tmp_gold.txt
)
examples/pytorch/graphwriter/prepare_data.sh
View file @
c23a61bd
wget https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/AGENDA.tar.gz
wget https://
data.
dgl.ai/dataset/AGENDA.tar.gz
mkdir
data
mkdir
data
tar
-C
data/
-xvzf
AGENDA.tar.gz
tar
-C
data/
-xvzf
AGENDA.tar.gz
examples/pytorch/metapath2vec/download.py
View file @
c23a61bd
...
@@ -24,7 +24,7 @@ class AminerDataset(object):
...
@@ -24,7 +24,7 @@ class AminerDataset(object):
"""
"""
def
__init__
(
self
,
path
):
def
__init__
(
self
,
path
):
self
.
url
=
'https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/aminer.zip'
self
.
url
=
'https://
data.
dgl.ai/dataset/aminer.zip'
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
'aminer.txt'
)):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
'aminer.txt'
)):
print
(
'File not found. Downloading from'
,
self
.
url
)
print
(
'File not found. Downloading from'
,
self
.
url
)
...
...
examples/pytorch/model_zoo/chem/generative_models/dgmg/README.md
View file @
c23a61bd
...
@@ -124,11 +124,11 @@ directory, with three statistics logged in `generation_stats.txt` under `eval_re
...
@@ -124,11 +124,11 @@ directory, with three statistics logged in `generation_stats.txt` under `eval_re
We also provide a jupyter notebook where you can visualize the generated molecules
We also provide a jupyter notebook where you can visualize the generated molecules


and compare their property distributions against the training molecule property distributions
and compare their property distributions against the training molecule property distributions


You can download the notebook with
`wget https://data.dgl.ai/dgllife/dgmg/eval_jupyter.ipynb`
.
You can download the notebook with
`wget https://data.dgl.ai/dgllife/dgmg/eval_jupyter.ipynb`
.
...
...
examples/pytorch/model_zoo/chem/property_prediction/README.md
View file @
c23a61bd
...
@@ -111,9 +111,9 @@ on the training and validation set for reference.
...
@@ -111,9 +111,9 @@ on the training and validation set for reference.
[8] visualizes the weights of atoms in readout for possible interpretations like the figure below.
[8] visualizes the weights of atoms in readout for possible interpretations like the figure below.
We provide a jupyter notebook for performing the visualization and you can download it with
We provide a jupyter notebook for performing the visualization and you can download it with
`wget https://
s3.us-east-2.amazonaws.com/
dgl.ai/model_zoo/drug_discovery/AttentiveFP/atom_weight_visualization.ipynb`
.
`wget https://
data.
dgl.ai/model_zoo/drug_discovery/AttentiveFP/atom_weight_visualization.ipynb`
.


## Dataset Customization
## Dataset Customization
...
...
examples/pytorch/pointcloud/main.py
View file @
c23a61bd
...
@@ -28,7 +28,7 @@ data_filename = 'modelnet40-sampled-2048.h5'
...
@@ -28,7 +28,7 @@ data_filename = 'modelnet40-sampled-2048.h5'
local_path
=
args
.
dataset_path
or
os
.
path
.
join
(
get_download_dir
(),
data_filename
)
local_path
=
args
.
dataset_path
or
os
.
path
.
join
(
get_download_dir
(),
data_filename
)
if
not
os
.
path
.
exists
(
local_path
):
if
not
os
.
path
.
exists
(
local_path
):
download
(
'https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/modelnet40-sampled-2048.h5'
,
local_path
)
download
(
'https://
data.
dgl.ai/dataset/modelnet40-sampled-2048.h5'
,
local_path
)
CustomDataLoader
=
partial
(
CustomDataLoader
=
partial
(
DataLoader
,
DataLoader
,
...
...
examples/pytorch/recommendation/README.md
View file @
c23a61bd
...
@@ -4,7 +4,7 @@ NOTE: this version is not using NodeFlow yet.
...
@@ -4,7 +4,7 @@ NOTE: this version is not using NodeFlow yet.
This example only work with Python 3.6+
This example only work with Python 3.6+
First, download and extract from https://dgl.ai
.s3.us-east-2.amazonaws.com
/dataset/ml-1m.tar.gz
First, download and extract from https://d
ata.d
gl.ai/dataset/ml-1m.tar.gz
One can then run the following to train PinSage on MovieLens-1M:
One can then run the following to train PinSage on MovieLens-1M:
...
...
examples/pytorch/rrn/sudoku_data.py
View file @
c23a61bd
...
@@ -56,7 +56,7 @@ class ListDataset(Dataset):
...
@@ -56,7 +56,7 @@ class ListDataset(Dataset):
def
_get_sudoku_dataset
(
segment
=
'train'
):
def
_get_sudoku_dataset
(
segment
=
'train'
):
assert
segment
in
[
'train'
,
'valid'
,
'test'
]
assert
segment
in
[
'train'
,
'valid'
,
'test'
]
url
=
"https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/sudoku-hard.zip"
url
=
"https://
data.
dgl.ai/dataset/sudoku-hard.zip"
zip_fname
=
"/tmp/sudoku-hard.zip"
zip_fname
=
"/tmp/sudoku-hard.zip"
dest_dir
=
'/tmp/sudoku-hard/'
dest_dir
=
'/tmp/sudoku-hard/'
...
...
examples/pytorch/rrn/sudoku_solver.py
View file @
c23a61bd
...
@@ -20,7 +20,7 @@ def solve_sudoku(puzzle):
...
@@ -20,7 +20,7 @@ def solve_sudoku(puzzle):
model_filename
=
os
.
path
.
join
(
model_path
,
'rrn-sudoku.pkl'
)
model_filename
=
os
.
path
.
join
(
model_path
,
'rrn-sudoku.pkl'
)
if
not
os
.
path
.
exists
(
model_filename
):
if
not
os
.
path
.
exists
(
model_filename
):
print
(
'Downloading model...'
)
print
(
'Downloading model...'
)
url
=
'https://
s3.us-east-2.amazonaws.com/
dgl.ai/models/rrn-sudoku.pkl'
url
=
'https://
data.
dgl.ai/models/rrn-sudoku.pkl'
urllib
.
request
.
urlretrieve
(
url
,
model_filename
)
urllib
.
request
.
urlretrieve
(
url
,
model_filename
)
model
=
torch
.
load
(
model_filename
,
map_location
=
'cpu'
)
model
=
torch
.
load
(
model_filename
,
map_location
=
'cpu'
)
...
...
examples/pytorch/transformer/dataset/utils.py
View file @
c23a61bd
...
@@ -4,8 +4,8 @@ import os
...
@@ -4,8 +4,8 @@ import os
from
dgl.data.utils
import
*
from
dgl.data.utils
import
*
_urls
=
{
_urls
=
{
'wmt'
:
'https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/wmt14bpe_de_en.zip'
,
'wmt'
:
'https://
data.
dgl.ai/dataset/wmt14bpe_de_en.zip'
,
'scripts'
:
'https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/transformer_scripts.zip'
,
'scripts'
:
'https://
data.
dgl.ai/dataset/transformer_scripts.zip'
,
}
}
def
prepare_dataset
(
dataset_name
):
def
prepare_dataset
(
dataset_name
):
...
...
python/dgl/contrib/sampling/sampler.py
View file @
c23a61bd
...
@@ -224,7 +224,7 @@ class NeighborSampler(NodeFlowSampler):
...
@@ -224,7 +224,7 @@ class NeighborSampler(NodeFlowSampler):
layer :math:`i+1` are in layer :math:`i`. All the edges are from nodes
layer :math:`i+1` are in layer :math:`i`. All the edges are from nodes
in layer :math:`i` to layer :math:`i+1`.
in layer :math:`i` to layer :math:`i+1`.
.. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/sampling/NodeFlow.png
.. image:: https://
data.
dgl.ai/tutorial/sampling/NodeFlow.png
As an analogy to mini-batch training, the ``batch_size`` here is equal to the number
As an analogy to mini-batch training, the ``batch_size`` here is equal to the number
of the initial seed nodes (number of nodes in the last layer).
of the initial seed nodes (number of nodes in the last layer).
...
...
python/dgl/nodeflow.py
View file @
c23a61bd
...
@@ -82,7 +82,7 @@ class NodeFlow(DGLBaseGraph):
...
@@ -82,7 +82,7 @@ class NodeFlow(DGLBaseGraph):
We store extra information, such as the node and edge mapping from
We store extra information, such as the node and edge mapping from
the NodeFlow graph to the parent graph.
the NodeFlow graph to the parent graph.
.. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/api/sampling.nodeflow.png
.. image:: https://
data.
dgl.ai/api/sampling.nodeflow.png
DO NOT create NodeFlow object directly. Use sampling method to
DO NOT create NodeFlow object directly. Use sampling method to
generate NodeFlow instead.
generate NodeFlow instead.
...
...
tutorials/basics/1_first.py
View file @
c23a61bd
...
@@ -32,7 +32,7 @@ At the end of this tutorial, we hope you get a brief feeling of how DGL works.
...
@@ -32,7 +32,7 @@ At the end of this tutorial, we hope you get a brief feeling of how DGL works.
# 33). The network is visualized as follows with the color indicating the
# 33). The network is visualized as follows with the color indicating the
# community:
# community:
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/img/karate-club.png
# .. image:: https://
data.
dgl.ai/tutorial/img/karate-club.png
# :align: center
# :align: center
#
#
# The task is to predict which side (0 or 33) each member tends to join given
# The task is to predict which side (0 or 33) each member tends to join given
...
@@ -135,7 +135,7 @@ print(G.nodes[[10, 11]].data['feat'])
...
@@ -135,7 +135,7 @@ print(G.nodes[[10, 11]].data['feat'])
# node will update its own feature with information sent from neighboring
# node will update its own feature with information sent from neighboring
# nodes. A graphical demonstration is displayed below.
# nodes. A graphical demonstration is displayed below.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/1_first/mailbox.png
# .. image:: https://
data.
dgl.ai/tutorial/1_first/mailbox.png
# :alt: mailbox
# :alt: mailbox
# :align: center
# :align: center
#
#
...
@@ -266,7 +266,7 @@ draw(0) # draw the prediction of the first epoch
...
@@ -266,7 +266,7 @@ draw(0) # draw the prediction of the first epoch
plt
.
close
()
plt
.
close
()
###############################################################################
###############################################################################
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/1_first/karate0.png
# .. image:: https://
data.
dgl.ai/tutorial/1_first/karate0.png
# :height: 300px
# :height: 300px
# :width: 400px
# :width: 400px
# :align: center
# :align: center
...
@@ -278,7 +278,7 @@ plt.close()
...
@@ -278,7 +278,7 @@ plt.close()
ani
=
animation
.
FuncAnimation
(
fig
,
draw
,
frames
=
len
(
all_logits
),
interval
=
200
)
ani
=
animation
.
FuncAnimation
(
fig
,
draw
,
frames
=
len
(
all_logits
),
interval
=
200
)
###############################################################################
###############################################################################
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/1_first/karate.gif
# .. image:: https://
data.
dgl.ai/tutorial/1_first/karate.gif
# :height: 300px
# :height: 300px
# :width: 400px
# :width: 400px
# :align: center
# :align: center
...
...
tutorials/basics/4_batch.py
View file @
c23a61bd
...
@@ -30,7 +30,7 @@ networks to this problem has been a popular approach recently. This can be seen
...
@@ -30,7 +30,7 @@ networks to this problem has been a popular approach recently. This can be seen
# In this tutorial, you learn how to perform batched graph classification
# In this tutorial, you learn how to perform batched graph classification
# with DGL. The example task objective is to classify eight types of topologies shown here.
# with DGL. The example task objective is to classify eight types of topologies shown here.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/batch/dataset_overview.png
# .. image:: https://
data.
dgl.ai/tutorial/batch/dataset_overview.png
# :align: center
# :align: center
#
#
# Implement a synthetic dataset :class:`data.MiniGCDataset` in DGL. The dataset has eight
# Implement a synthetic dataset :class:`data.MiniGCDataset` in DGL. The dataset has eight
...
@@ -64,7 +64,7 @@ plt.show()
...
@@ -64,7 +64,7 @@ plt.show()
# a batch of graphs can be viewed as a large graph that has many disjointed
# a batch of graphs can be viewed as a large graph that has many disjointed
# connected components. Below is a visualization that gives the general idea.
# connected components. Below is a visualization that gives the general idea.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/batch/batch.png
# .. image:: https://
data.
dgl.ai/tutorial/batch/batch.png
# :width: 400pt
# :width: 400pt
# :align: center
# :align: center
#
#
...
@@ -91,7 +91,7 @@ def collate(samples):
...
@@ -91,7 +91,7 @@ def collate(samples):
# ----------------
# ----------------
# Graph classification proceeds as follows.
# Graph classification proceeds as follows.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/batch/graph_classifier.png
# .. image:: https://
data.
dgl.ai/tutorial/batch/graph_classifier.png
#
#
# From a batch of graphs, perform message passing and graph convolution
# From a batch of graphs, perform message passing and graph convolution
# for nodes to communicate with others. After message passing, compute a
# for nodes to communicate with others. After message passing, compute a
...
@@ -254,16 +254,16 @@ print('Accuracy of argmax predictions on the test set: {:4f}%'.format(
...
@@ -254,16 +254,16 @@ print('Accuracy of argmax predictions on the test set: {:4f}%'.format(
###############################################################################
###############################################################################
# The animation here plots the probability that a trained model predicts the correct graph type.
# The animation here plots the probability that a trained model predicts the correct graph type.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/batch/test_eval4.gif
# .. image:: https://
data.
dgl.ai/tutorial/batch/test_eval4.gif
#
#
# To understand the node and graph representations that a trained model learned,
# To understand the node and graph representations that a trained model learned,
# we use `t-SNE, <https://lvdmaaten.github.io/tsne/>`_ for dimensionality reduction
# we use `t-SNE, <https://lvdmaaten.github.io/tsne/>`_ for dimensionality reduction
# and visualization.
# and visualization.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/batch/tsne_node2.png
# .. image:: https://
data.
dgl.ai/tutorial/batch/tsne_node2.png
# :align: center
# :align: center
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/batch/tsne_graph2.png
# .. image:: https://
data.
dgl.ai/tutorial/batch/tsne_graph2.png
# :align: center
# :align: center
#
#
# The two small figures on the top separately visualize node representations after one and two
# The two small figures on the top separately visualize node representations after one and two
...
...
tutorials/basics/5_hetero.py
View file @
c23a61bd
...
@@ -46,7 +46,7 @@ using the heterograph class and its associated API.
...
@@ -46,7 +46,7 @@ using the heterograph class and its associated API.
# The following diagram shows several entities in the ACM dataset and the relationships among them
# The following diagram shows several entities in the ACM dataset and the relationships among them
# (taken from `Shi et al., 2015 <https://arxiv.org/pdf/1511.04854.pdf>`_).
# (taken from `Shi et al., 2015 <https://arxiv.org/pdf/1511.04854.pdf>`_).
#
#
# .. figure:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/hetero/acm-example.png#
# .. figure:: https://
data.
dgl.ai/tutorial/hetero/acm-example.png#
#
#
# This graph has three types of entities that correspond to papers, authors, and publication venues.
# This graph has three types of entities that correspond to papers, authors, and publication venues.
# It also contains three types of edges that connect the following:
# It also contains three types of edges that connect the following:
...
@@ -70,7 +70,7 @@ using the heterograph class and its associated API.
...
@@ -70,7 +70,7 @@ using the heterograph class and its associated API.
# marked with a rating, then each rating value could correspond to a different edge type.
# marked with a rating, then each rating value could correspond to a different edge type.
# The following diagram shows an example of user-item interactions as a heterograph.
# The following diagram shows an example of user-item interactions as a heterograph.
#
#
# .. figure:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/hetero/recsys-example.png
# .. figure:: https://
data.
dgl.ai/tutorial/hetero/recsys-example.png
#
#
#
#
# Knowledge graph
# Knowledge graph
...
@@ -81,7 +81,7 @@ using the heterograph class and its associated API.
...
@@ -81,7 +81,7 @@ using the heterograph class and its associated API.
# occupation (item P106) is politician (item Q82955). The relationships are shown in the following.
# occupation (item P106) is politician (item Q82955). The relationships are shown in the following.
# diagram.
# diagram.
#
#
# .. figure:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/hetero/kg-example.png
# .. figure:: https://
data.
dgl.ai/tutorial/hetero/kg-example.png
#
#
###############################################################################
###############################################################################
...
@@ -144,7 +144,7 @@ ratings = dgl.heterograph(
...
@@ -144,7 +144,7 @@ ratings = dgl.heterograph(
import
scipy.io
import
scipy.io
import
urllib.request
import
urllib.request
data_url
=
'https://
s3.us-east-2.amazonaws.com/
dgl.ai/dataset/ACM.mat'
data_url
=
'https://
data.
dgl.ai/dataset/ACM.mat'
data_file_path
=
'/tmp/ACM.mat'
data_file_path
=
'/tmp/ACM.mat'
urllib
.
request
.
urlretrieve
(
data_url
,
data_file_path
)
urllib
.
request
.
urlretrieve
(
data_url
,
data_file_path
)
...
...
tutorials/models/1_gnn/8_sse_mx.py
View file @
c23a61bd
...
@@ -567,6 +567,6 @@ for i in range(n_epochs):
...
@@ -567,6 +567,6 @@ for i in range(n_epochs):
#
#
# For full examples, see `Benchmark SSE on multi-GPUs <https://github.com/dmlc/dgl/tree/master/examples/mxnet/sse>`_ on Github.
# For full examples, see `Benchmark SSE on multi-GPUs <https://github.com/dmlc/dgl/tree/master/examples/mxnet/sse>`_ on Github.
#
#
# .. |image0| image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/img/floodfill-paths.gif
# .. |image0| image:: https://
data.
dgl.ai/tutorial/img/floodfill-paths.gif
# .. |image1| image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/img/neighbor-sampling.gif
# .. |image1| image:: https://
data.
dgl.ai/tutorial/img/neighbor-sampling.gif
# .. |image2| image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/img/sse.gif
# .. |image2| image:: https://
data.
dgl.ai/tutorial/img/sse.gif
tutorials/models/1_gnn/9_gat.py
View file @
c23a61bd
...
@@ -55,7 +55,7 @@ structure-free normalization, in the style of attention.
...
@@ -55,7 +55,7 @@ structure-free normalization, in the style of attention.
# embedding :math:`h_i^{(l+1)}` of layer :math:`l+1` from the embeddings of
# embedding :math:`h_i^{(l+1)}` of layer :math:`l+1` from the embeddings of
# layer :math:`l`.
# layer :math:`l`.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/gat/gat.png
# .. image:: https://
data.
dgl.ai/tutorial/gat/gat.png
# :width: 450px
# :width: 450px
# :align: center
# :align: center
#
#
...
@@ -355,7 +355,7 @@ for epoch in range(30):
...
@@ -355,7 +355,7 @@ for epoch in range(30):
# to their labels, whereas the edges are colored according to the magnitude of
# to their labels, whereas the edges are colored according to the magnitude of
# the attention weights, which can be referred with the colorbar on the right.
# the attention weights, which can be referred with the colorbar on the right.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/gat/cora-attention.png
# .. image:: https://
data.
dgl.ai/tutorial/gat/cora-attention.png
# :width: 600px
# :width: 600px
# :align: center
# :align: center
#
#
...
@@ -383,7 +383,7 @@ for epoch in range(30):
...
@@ -383,7 +383,7 @@ for epoch in range(30):
#
#
# As a reference, here is the histogram if all the nodes have uniform attention weight distribution.
# As a reference, here is the histogram if all the nodes have uniform attention weight distribution.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/gat/cora-attention-uniform-hist.png
# .. image:: https://
data.
dgl.ai/tutorial/gat/cora-attention-uniform-hist.png
# :width: 250px
# :width: 250px
# :align: center
# :align: center
#
#
...
@@ -453,7 +453,7 @@ for epoch in range(30):
...
@@ -453,7 +453,7 @@ for epoch in range(30):
# learning curves of GAT and GCN are presented below; what is evident is the
# learning curves of GAT and GCN are presented below; what is evident is the
# dramatic performance adavantage of GAT over GCN.
# dramatic performance adavantage of GAT over GCN.
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/gat/ppi-curve.png
# .. image:: https://
data.
dgl.ai/tutorial/gat/ppi-curve.png
# :width: 300px
# :width: 300px
# :align: center
# :align: center
#
#
...
@@ -475,7 +475,7 @@ for epoch in range(30):
...
@@ -475,7 +475,7 @@ for epoch in range(30):
#
#
# Again, comparing with uniform distribution:
# Again, comparing with uniform distribution:
#
#
# .. image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/gat/ppi-uniform-hist.png
# .. image:: https://
data.
dgl.ai/tutorial/gat/ppi-uniform-hist.png
# :width: 250px
# :width: 250px
# :align: center
# :align: center
#
#
...
@@ -502,7 +502,7 @@ for epoch in range(30):
...
@@ -502,7 +502,7 @@ for epoch in range(30):
# * See the optimized `full example <https://github.com/dmlc/dgl/blob/master/examples/pytorch/gat/gat.py>`_.
# * See the optimized `full example <https://github.com/dmlc/dgl/blob/master/examples/pytorch/gat/gat.py>`_.
# * The next tutorial describes how to speedup GAT models by parallelizing multiple attention heads and SPMV optimization.
# * The next tutorial describes how to speedup GAT models by parallelizing multiple attention heads and SPMV optimization.
#
#
# .. |image2| image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/gat/cora-attention-hist.png
# .. |image2| image:: https://
data.
dgl.ai/tutorial/gat/cora-attention-hist.png
# .. |image5| image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/gat/ppi-first-layer-hist.png
# .. |image5| image:: https://
data.
dgl.ai/tutorial/gat/ppi-first-layer-hist.png
# .. |image6| image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/gat/ppi-second-layer-hist.png
# .. |image6| image:: https://
data.
dgl.ai/tutorial/gat/ppi-second-layer-hist.png
# .. |image7| image:: https://
s3.us-east-2.amazonaws.com/
dgl.ai/tutorial/gat/ppi-final-layer-hist.png
# .. |image7| image:: https://
data.
dgl.ai/tutorial/gat/ppi-final-layer-hist.png
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment