Skip to content

Commit 1f62785

Browse files
committed
update doc and readme
1 parent 8c306f3 commit 1f62785

52 files changed

Lines changed: 360 additions & 362 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@
88
[![Documentation Status](https://readthedocs.org/projects/deephypergraph/badge/?version=latest)](https://deephypergraph.readthedocs.io/en/latest/?badge=latest)
99
[![PyPI downloads](https://img.shields.io/pypi/dm/dhg.svg)](https://pypistats.org/packages/dhg)
1010
[![Visits Badge](https://visitor-badge.glitch.me/badge?page_id=iMoonLab.DeepHypergraph)](https://visitor-badge.glitch.me/)
11-
[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)
11+
<!-- [![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black) -->
1212
[![license](https://img.shields.io/github/license/imoonlab/DeepHypergraph)](LICENSE)
13-
[![Supported Python versions](https://img.shields.io/pypi/pyversions/dhg)](https://pypi.org/project/dhg/)
13+
<!-- [![Supported Python versions](https://img.shields.io/pypi/pyversions/dhg)](https://pypi.org/project/dhg/) -->
1414

1515

16-
**[Website](https://deephypergraph.com/)** | **[Documentation](https://deephypergraph.readthedocs.io/)** | **[Tutorials](https://deephypergraph.readthedocs.io/en/latest/tutorial/overview.html)** | **[中文教程](https://deephypergraph.readthedocs.io/en/latest/zh/overview.html)** | **[Official Examples](https://deephypergraph.readthedocs.io/en/latest/examples/vertex_cls/index.html)** | **[Discussions](https://github.com/iMoonLab/DeepHypergraph/discussions)**
16+
**[Website](https://deephypergraph.com/)** | **[Documentation](https://deephypergraph.readthedocs.io/)** | **[Tutorials](https://deephypergraph.readthedocs.io/en/latest/tutorial/overview.html)** | **[中文文档](https://deephypergraph.readthedocs.io/en/latest/zh/overview.html)** | **[Official Examples](https://deephypergraph.readthedocs.io/en/latest/examples/vertex_cls/index.html)** | **[Discussions](https://github.com/iMoonLab/DeepHypergraph/discussions)**
1717

1818
<p align="center">
19-
We are rushing the documentation and tutorials, which will be updated twice a day!<br>
2019
The v0.9.2 will be released soon, which will include many structure visualizations!<br>
21-
我们正在加快文档和教程的更新,每天会在午饭和晚饭期间进行两次更新!<br>
2220
我们很快将发布v0.9.2版本,其中包含了各种关联结构的可视化!
2321
</p>
2422

@@ -29,7 +27,7 @@ The v0.9.2 will be released soon, which will include many structure visualizatio
2927

3028
**DHG** *(DeepHypergraph)* is a deep learning library built upon [PyTorch](https://pytorch.org) for learning with both Graph Neural Networks and Hypergraph Neural Networks. It is a general framework that supports both low-order and high-order message passing like **from vertex to vertex**, **from vertex in one domain to vertex in another domain**, **from vertex to hyperedge**, **from hyperedge to vertex**, **from vertex set to vertex set**.
3129

32-
It supports a wide variety of structures like low-order structures (simple graph, directed graph, bipartite graph, etc.), high-order structures (simple hypergraph, etc.). Various spectral-based operations (like Laplacian-based smoothing) and spatial-based operations (like message psssing from domain to domain) are integrated inside different structures. It provides multiple common metrics for performance evaluation on different tasks. Many state-of-the-art models are implemented and can be easily used for research. We also provide various visualization tools for both low-order structures and high-order structures.
30+
It supports a wide variety of structures like low-order structures (graph, directed graph, bipartite graph, etc.), high-order structures (hypergraph, etc.). Various spectral-based operations (like Laplacian-based smoothing) and spatial-based operations (like message psssing from domain to domain) are integrated inside different structures. It provides multiple common metrics for performance evaluation on different tasks. Many state-of-the-art models are implemented and can be easily used for research. We also provide various visualization tools for both low-order structures and high-order structures.
3331

3432
In addition, DHG's [dhg.experiments](https://deephypergraph.readthedocs.io/en/latest/api/experiments.html) module (that implements **Auto-ML** upon [Optuna](https://optuna.org)) can help you automatically tune the hyper-parameters of your models in training and easily outperforms the state-of-the-art models.
3533

@@ -56,10 +54,10 @@ DHG is built upon Pytorch, and any Pytorch-based models can be integrated into D
5654
DHG provides various Laplacian matrices and message passing functions to help build your spectral/spatial-based models, respectively.
5755

5856
- **Visualization of Graphs and Hypergraphs**
59-
DHG provides a powerful visualization tool for graphs and hypergraphs. You can easily visualize the structure of your graphs and hypergraphs.
57+
DHG provides a powerful visualization tool for graph and hypergraph. You can easily visualize the structure of your graph and hypergraph.
6058

6159
- **Bridge the Gap between Graphs and Hypergraphs**:
62-
DHG provides functions to build hypergraphs from graphs and build graphs from hypergraphs. Maybe promoting the graphs to hypergraphs can exploit those potential high-order connections and improve the performance of your model.
60+
DHG provides functions to build hypergraph from graph and build graph from hypergraph. Maybe promoting the graph to hypergraph can exploit those potential high-order connections and improve the performance of your model.
6361

6462
- **Attach Spectral/Spatial-Based Operations to Structure**:
6563
In DHG, those Laplacian matrices and message passing functions are attached to the graph/hypergraph structure. As soon as you build a structure with DHG, those functions will be ready to be used in the process of building your model.
@@ -84,7 +82,7 @@ pip install dhg
8482

8583
### Learning on Low-Order Structures
8684

87-
On simple graph structures, you can smooth a given vertex features with GCN's Laplacian matrix by:
85+
On graph structures, you can smooth a given vertex features with GCN's Laplacian matrix by:
8886

8987
```python
9088
import torch
@@ -94,7 +92,7 @@ X = torch.rand(5, 2)
9492
X_ = g.smoothing_with_GCN(X)
9593
```
9694

97-
On simple graph structures, you can pass messages from vertex to vertex with `mean` aggregation by:
95+
On graph structures, you can pass messages from vertex to vertex with `mean` aggregation by:
9896

9997
```python
10098
import torch
@@ -138,7 +136,7 @@ X_v_ = g.u2v(X_u, aggr="mean")
138136

139137
### Learning on High-Order Structures
140138

141-
On simple hypergraph structures, you can smooth a given vertex features with HGNN's Laplacian matrix by:
139+
On hypergraph structures, you can smooth a given vertex features with HGNN's Laplacian matrix by:
142140

143141
```python
144142
import torch
@@ -148,7 +146,7 @@ X = torch.rand(5, 2)
148146
X_ = hg.smoothing_with_HGNN(X)
149147
```
150148

151-
On simple hypergraph structures, you can pass messages from vertex to hyperedge with `mean` aggregation by:
149+
On hypergraph structures, you can pass messages from vertex to hyperedge with `mean` aggregation by:
152150

153151
```python
154152
import torch
@@ -362,7 +360,7 @@ If you find **DHG** is useful in your research, please consider citing:
362360

363361
## The DHG Team
364362

365-
DHG is developed by DHG's core team including [Yifan Feng](http://fengyifan.site/), [Xinwei Zhang](https://github.com/zhangxwww), and [Yue Gao (Adivsor)](http://moon-lab.tech/). It is maintained by the [iMoon-Lab](http://moon-lab.tech/), Tsinghua University. You can contact us at [email](mailto:evanfeng97@gmail.com).
363+
DHG is developed by DHG's core team including [Yifan Feng](http://fengyifan.site/), [Xinwei Zhang](https://github.com/zhangxwww), [Jielong Yan](https://github.com/JasonYanjl), [Shuyi Ji](), [Yue Gao](http://moon-lab.tech/), and [Qionghai Dai](https://ysg.ckcest.cn/html/details/8058/index.html). It is maintained by the [iMoon-Lab](http://moon-lab.tech/), Tsinghua University. You can contact us at [email](mailto:evanfeng97@gmail.com).
366364

367365

368366
## License

‎dhg/experiments/graphs/graph.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class GraphVertexClassificationTask(VertexClassificationTask):
13-
r"""The auto-experiment class for the vertex classification task on graphs.
13+
r"""The auto-experiment class for the vertex classification task on graph.
1414
1515
Args:
1616
``work_root`` (``Optional[Union[str, Path]]``): User's work root to store all studies.
@@ -55,7 +55,7 @@ def to(self, device: torch.device):
5555

5656
@property
5757
def vars_for_DL(self):
58-
r"""Return a name list for available variables for deep learning in the vertex classification on graphs. The name list includes ``features``, ``structure``, ``labels``, ``train_mask``, ``val_mask``, and ``test_mask``.
58+
r"""Return a name list for available variables for deep learning in the vertex classification on graph. The name list includes ``features``, ``structure``, ``labels``, ``train_mask``, ``val_mask``, and ``test_mask``.
5959
"""
6060
return super().vars_for_DL
6161

‎dhg/experiments/hypergraphs/hypergraph.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class HypergraphVertexClassificationTask(VertexClassificationTask):
13-
r"""The auto-experiment class for the vertex classification task on hypergraphs.
13+
r"""The auto-experiment class for the vertex classification task on hypergraph.
1414
1515
Args:
1616
``work_root`` (``Optional[Union[str, Path]]``): User's work root to store all studies.
@@ -58,7 +58,7 @@ def to(self, device: torch.device):
5858

5959
@property
6060
def vars_for_DL(self):
61-
r"""Return a name list for available variables for deep learning in the vertex classification on hypergraphs. The name list includes ``features``, ``structure``, ``labels``, ``train_mask``, ``val_mask``, and ``test_mask``.
61+
r"""Return a name list for available variables for deep learning in the vertex classification on hypergraph. The name list includes ``features``, ``structure``, ``labels``, ``train_mask``, ``val_mask``, and ``test_mask``.
6262
"""
6363
return super().vars_for_DL
6464

‎dhg/experiments/recommender.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class UserItemRecommenderTask(BaseTask):
13-
r"""The auto-experiment class for the recommender task on user-item bipartite graphs.
13+
r"""The auto-experiment class for the recommender task on user-item bipartite graph.
1414
1515
Args:
1616
``work_root`` (``Optional[Union[str, Path]]``): User's work root to store all studies.
@@ -63,7 +63,7 @@ def to(self, device: torch.device):
6363

6464
@property
6565
def vars_for_DL(self):
66-
r"""Return a name list for available deep learning variables for the recommender task on user-item bipartite graphs. The name list includes ``structure``.
66+
r"""Return a name list for available deep learning variables for the recommender task on user-item bipartite graph. The name list includes ``structure``.
6767
"""
6868
return ("structure",)
6969

‎dhg/metrics/recommender.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def ndcg(
166166

167167

168168
class UserItemRecommenderEvaluator(BaseEvaluator):
169-
r"""Return the metric evaluator for recommender task on user-item bipartite graphs. The supported metrics includes: ``precision``, ``recall``, ``ndcg``.
169+
r"""Return the metric evaluator for recommender task on user-item bipartite graph. The supported metrics includes: ``precision``, ``recall``, ``ndcg``.
170170
171171
Args:
172172
``metric_configs`` (``List[Union[str, Dict[str, dict]]]``): The metric configurations. The key is the metric name and the value is the metric parameters.

‎dhg/structure/base.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def from_adj_list(num_v: int, adj_list: List[List[int]], extra_selfloop: bool =
154154
r"""Construct a graph from the adjacency list. Each line in the adjacency list has two components. The first element in each line is the source vertex index, and the rest elements are the target vertex indices that connected to the source vertex.
155155
156156
.. note::
157-
This function can only construct unweighted graphs.
157+
This function can only construct unweighted graph.
158158
159159
Args:
160160
``num_v`` (``int``): The number of vertices.

‎dhg/structure/graphs/bipartite_graph.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class BiGraph(BaseGraph):
15-
r""" Class for bipartite graphs.
15+
r""" Class for bipartite graph.
1616
1717
Args:
1818
``num_u`` (``int``): The Number of vertices in set :math:`\mathcal{U}`.

‎dhg/structure/graphs/directed_graph.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class DiGraph(BaseGraph):
15-
r""" Class for directed graphs.
15+
r""" Class for directed graph.
1616
1717
Args:
1818
``num_v`` (``int``): The Number of vertices.

‎dhg/structure/graphs/graph.py‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
class Graph(BaseGraph):
16-
r""" Class for simple graphs (undirected graphs).
16+
r""" Class for graph (undirected graph).
1717
1818
Args:
1919
``num_v`` (``int``): The number of vertices.
@@ -40,11 +40,11 @@ def __init__(
4040
def __repr__(self) -> str:
4141
r"""Print the graph information.
4242
"""
43-
return f"Simple Graph(num_v={self.num_v}, num_e={self.num_e})"
43+
return f"Graph(num_v={self.num_v}, num_e={self.num_e})"
4444

4545
@property
4646
def state_dict(self) -> Dict[str, Any]:
47-
r"""Get the state dict of the simple graph.
47+
r"""Get the state dict of the graph.
4848
"""
4949
return {
5050
"num_v": self.num_v,
@@ -111,7 +111,7 @@ def draw(
111111
pull_e_strength: float = 1.0,
112112
pull_center_strength: float = 1.0,
113113
):
114-
r"""Draw the simple graph structure. The supported edge styles are: ``'line'`` and ``'circle'``.
114+
r"""Draw the graph structure. The supported edge styles are: ``'line'`` and ``'circle'``.
115115
116116
Args:
117117
``e_style`` (``str``): The edge style. The supported edge styles are: ``'line'`` and ``'circle'``. Defaults to ``'line'``.
@@ -151,7 +151,7 @@ def to(self, device: torch.device):
151151
r"""Move the graph to the specified device.
152152
153153
Args:
154-
``device`` (``torch.device``): The device to store the simple graph.
154+
``device`` (``torch.device``): The device to store the graph.
155155
"""
156156
return super().to(device)
157157

@@ -167,7 +167,7 @@ def from_adj_list(
167167
r"""Construct a graph from the adjacency list. Each line in the adjacency list has two components. The first element in each line is the source vertex index, and the rest elements are the target vertex indices that connected to the source vertex.
168168
169169
.. note::
170-
This function can only construct the unweighted simple graph.
170+
This function can only construct the unweighted graph.
171171
172172
Args:
173173
``num_v`` (``int``): The number of vertices.
@@ -344,7 +344,7 @@ def v(self) -> List[int]:
344344

345345
@property
346346
def e(self) -> Tuple[List[List[int]], List[float]]:
347-
r"""Return the edge list and weight list in the simple graph.
347+
r"""Return the edge list and weight list in the graph.
348348
"""
349349
return super().e
350350

@@ -361,19 +361,19 @@ def e_both_side(self) -> Tuple[List[List], List[float]]:
361361

362362
@property
363363
def num_v(self) -> int:
364-
r"""Return the number of vertices in the simple graph.
364+
r"""Return the number of vertices in the graph.
365365
"""
366366
return super().num_v
367367

368368
@property
369369
def num_e(self) -> int:
370-
r"""Return the number of edges in the simple graph.
370+
r"""Return the number of edges in the graph.
371371
"""
372372
return super().num_e
373373

374374
@property
375375
def deg_v(self) -> List[int]:
376-
r"""Return the degree list of each vertex in the simple graph.
376+
r"""Return the degree list of each vertex in the graph.
377377
"""
378378
return self.D_v._values().cpu().numpy().tolist()
379379

@@ -389,7 +389,7 @@ def nbr_v(self, v_idx: int) -> Tuple[List[int], List[float]]:
389389
# properties for deep learning
390390
@property
391391
def vars_for_DL(self) -> List[str]:
392-
r"""Return a name list of available variables for deep learning in the simple graph including
392+
r"""Return a name list of available variables for deep learning in the graph including
393393
394394
Sparse Matrices:
395395

0 commit comments

Comments
 (0)