Unverified Commit 0ce92a86 authored by Kay Liu's avatar Kay Liu Committed by GitHub
Browse files

[BugFix] fix problems found in bug bash (#3116)



* fix breakline in fakenews.py

* fix inconsistent argument name

* modify incorrect example and deprecated graph type

* modify docstring and example in knn_graph

* fix incorrect node type
Co-authored-by: default avatarQuan (Andy) Gan <coin2028@hotmail.com>
parent c7449818
......@@ -43,17 +43,17 @@ python n_body_sim.py --num_traj <num_traj> --steps <num_steps>
```python
python train.py --number_workers 15
python train.py --num_workers 15
```
Training with GPU
```python
python train.py --gpu 0 --number_workers 15
python train.py --gpu 0 --num_workers 15
```
Training with visualization: for valid visualization, it might take full 40000 epoch of training
```python
python train.py --gpu 0 --number_workers 15 --visualize
python train.py --gpu 0 --num_workers 15 --visualize
```
One Step Loss Performance, Loss of test data after 40000 training epochs.
......
......@@ -20,18 +20,10 @@ class FakeNewsDataset(DGLBuiltinDataset):
who retweeted the root news. Besides, the node features are encoded
user historical tweets using different pretrained language models:
- bert: the 768-dimensional node feature composed of Twitter user
historical tweets encoded by the bert-as-service
- content: the 310-dimensional node feature composed of a
300-dimensional “spacy” vector plus a 10-dimensional
“profile” vector
- profile: the 10-dimensional node feature composed of ten Twitter
user profile attributes.
- spacy: the 300-dimensional node feature composed of Twitter user
historical tweets encoded by the spaCy word2vec encoder.
- bert: the 768-dimensional node feature composed of Twitter user historical tweets encoded by the bert-as-service
- content: the 310-dimensional node feature composed of a 300-dimensional “spacy” vector plus a 10-dimensional “profile” vector
- profile: the 10-dimensional node feature composed of ten Twitter user profile attributes.
- spacy: the 300-dimensional node feature composed of Twitter user historical tweets encoded by the spaCy word2vec encoder.
Note: this dataset is for academic use only, and commercial use is prohibited.
......
......@@ -51,7 +51,7 @@ class FraudDataset(DGLBuiltinDataset):
----------
num_classes : int
Number of label classes
graph : dgl.heterograph.DGLHeteroGraph
graph : dgl.DGLGraph
Graph structure, etc.
seed : int
Random seed in splitting the dataset.
......@@ -65,8 +65,8 @@ class FraudDataset(DGLBuiltinDataset):
>>> dataset = FraudDataset('yelp')
>>> graph = dataset[0]
>>> num_classes = dataset.num_classes
>>> feat = dataset.ndata['feature']
>>> label = dataset.ndata['label']
>>> feat = graph.ndata['feature']
>>> label = graph.ndata['label']
"""
file_urls = {
'yelp': 'dataset/FraudYelp.zip',
......@@ -81,8 +81,8 @@ class FraudDataset(DGLBuiltinDataset):
'amazon': 'Amazon.mat'
}
node_name = {
'yelp': 'user',
'amazon': 'review'
'yelp': 'review',
'amazon': 'user'
}
def __init__(self, name, raw_dir=None, random_seed=717, train_size=0.7, val_size=0.1):
......@@ -126,7 +126,7 @@ class FraudDataset(DGLBuiltinDataset):
Returns
-------
:class:`dgl.heterograph.DGLHeteroGraph`
:class:`dgl.DGLGraph`
graph structure, node features, node labels and masks
- ``ndata['feature']``: node features
......@@ -249,8 +249,8 @@ class FraudYelpDataset(FraudDataset):
>>> dataset = FraudYelpDataset()
>>> graph = dataset[0]
>>> num_classes = dataset.num_classes
>>> feat = dataset.ndata['feature']
>>> label = dataset.ndata['label']
>>> feat = graph.ndata['feature']
>>> label = graph.ndata['label']
"""
def __init__(self, raw_dir=None, random_seed=717, train_size=0.7, val_size=0.1):
......@@ -318,8 +318,8 @@ class FraudAmazonDataset(FraudDataset):
>>> dataset = FraudAmazonDataset()
>>> graph = dataset[0]
>>> num_classes = dataset.num_classes
>>> feat = dataset.ndata['feature']
>>> label = dataset.ndata['label']
>>> feat = graph.ndata['feature']
>>> label = graph.ndata['label']
"""
def __init__(self, raw_dir=None, random_seed=717, train_size=0.7, val_size=0.1):
......
......@@ -122,7 +122,7 @@ def knn_graph(x, k, algorithm='bruteforce-blas', dist='euclidean'):
This method is suitable for low-dimensional data (e.g. 3D
point clouds)
* 'nn-descent' is a approximate approach from paper
* 'nn-descent' is an approximate approach from paper
`Efficient k-nearest neighbor graph construction for generic similarity
measures <https://www.cs.princeton.edu/cass/papers/www11.pdf>`_. This method
will search for nearest neighbor candidates in "neighbors' neighbors".
......@@ -156,7 +156,7 @@ def knn_graph(x, k, algorithm='bruteforce-blas', dist='euclidean'):
... [0.3, 0.2, 0.4]])
>>> knn_g = dgl.knn_graph(x, 2) # Each node has two predecessors
>>> knn_g.edges()
>>> (tensor([0, 1, 2, 2, 2, 3, 3, 3]), tensor([0, 1, 1, 2, 3, 0, 2, 3]))
(tensor([0, 1, 2, 2, 2, 3, 3, 3]), tensor([0, 1, 1, 2, 3, 0, 2, 3]))
When :attr:`x` is a 3D tensor, DGL constructs multiple KNN graphs and
and then composes them into a graph of multiple connected components.
......@@ -297,7 +297,7 @@ def segmented_knn_graph(x, k, segs, algorithm='bruteforce-blas', dist='euclidean
This method is suitable for low-dimensional data (e.g. 3D
point clouds)
* 'nn-descent' is a approximate approach from paper
* 'nn-descent' is an approximate approach from paper
`Efficient k-nearest neighbor graph construction for generic similarity
measures <https://www.cs.princeton.edu/cass/papers/www11.pdf>`_. This method
will search for nearest neighbor candidates in "neighbors' neighbors".
......@@ -533,7 +533,7 @@ def knn(k, x, x_segs, y=None, y_segs=None, algorithm='bruteforce', dist='euclide
This method is suitable for low-dimensional data (e.g. 3D
point clouds)
* 'nn-descent' is a approximate approach from paper
* 'nn-descent' is an approximate approach from paper
`Efficient k-nearest neighbor graph construction for generic similarity
measures <https://www.cs.princeton.edu/cass/papers/www11.pdf>`_. This method
will search for nearest neighbor candidates in "neighbors' neighbors".
......
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