Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Dec 3, 2019
1 parent 4e9684d commit 1d36674
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions torch_geometric/transforms/gdc.py
Expand Up @@ -137,18 +137,15 @@ def transition_matrix(self, edge_index, edge_weight, num_nodes,
edge_index (LongTensor): The edge indices.
edge_weight (Tensor): One-dimensional edge weights.
num_nodes (int): Number of nodes.
normalization (str): Normalization scheme. Options:
1. :obj:`"sym"`: Symmetric normalization:
:math:`\mathbf{T} = \mathbf{D}^{-1/2} \mathbf{A}
\mathbf{D}^{-1/2}`
2. :obj:`"col"`: Column-wise normalization:
:math:`\mathbf{T} = \mathbf{A} \mathbf{D}^{-1}`
3. :obj:`"row"`: Row-wise normalization:
:math:`\mathbf{T} = \mathbf{D}^{-1} \mathbf{A}`
normalization (str): Normalization scheme:
1. :obj:`"sym"`: Symmetric normalization
:math:`\mathbf{T} = \mathbf{D}^{-1/2} \mathbf{A}
\mathbf{D}^{-1/2}`.
2. :obj:`"col"`: Column-wise normalization
:math:`\mathbf{T} = \mathbf{A} \mathbf{D}^{-1}`.
3. :obj:`"row"`: Row-wise normalization
:math:`\mathbf{T} = \mathbf{D}^{-1} \mathbf{A}`.
4. :obj:`None`: No normalization.
:rtype: (:class:`LongTensor`, :class:`Tensor`)
Expand Down Expand Up @@ -201,21 +198,26 @@ def diffusion_matrix_exact(self, edge_index, edge_weight, num_nodes,
edge_index (LongTensor): The edge indices.
edge_weight (Tensor): One-dimensional edge weights.
num_nodes (int): Number of nodes.
method (str): Diffusion method. Options:
method (str): Diffusion method:
1. :obj:`"ppr"`: Use personalized PageRank as diffusion.
Additionally expects the parameter:
- alpha (float): Return probability in PPR. Commonly lies in
:obj:`[0.05, 0.2]`.
Additionally expects the parameter:
2. `"heat"`: Use heat kernel diffusion.
Additionally expects the parameter:
- :obj:`t` (float): Time of diffusion. Commonly lies in
:obj:`[2, 10]`.
- **alpha** (*float*) - Return probability in PPR.
Commonly lies in :obj:`[0.05, 0.2]`.
2. :obj:`"heat"`: Use heat kernel diffusion.
Additionally expects the parameter:
- **t** (*float*) - Time of diffusion. Commonly lies in
:obj:`[2, 10]`.
3. :obj:`"coeff"`: Freely choose diffusion coefficients.
Additionally expects the parameter:
- coeffs (List[float]): List of coefficients :obj:`theta_k`
for each power of the transition matrix (starting at :obj:`0`).
Additionally expects the parameter:
- **coeffs** (*List[float]*) - List of coefficients
:obj:`theta_k` for each power of the transition matrix
(starting at :obj:`0`).
:rtype: (:class:`Tensor`)
"""
Expand Down Expand Up @@ -264,17 +266,17 @@ def diffusion_matrix_approx(self, edge_index, edge_weight, num_nodes,
normalization (str): Transition matrix normalization scheme
(:obj:`"sym"`, :obj:`"row"`, or :obj:`"col"`).
See :func:`GDC.transition_matrix` for details.
method (str): Diffusion method. Options:
method (str): Diffusion method:
1. :obj:`"ppr"`: Use personalized PageRank as diffusion.
Additionally expects the parameters:
Additionally expects the parameters:
- **alpha** (*float*): Return probability in PPR.
Commonly lies in :obj:`[0.05, 0.2]`.
- **alpha** (*float*) - Return probability in PPR.
Commonly lies in :obj:`[0.05, 0.2]`.
- **eps** (*float*): Threshold for PPR calculation stopping
criterion (:obj:`edge_weight >= eps * out_degree`).
Recommended default: :obj:`1e-4`.
- **eps** (*float*) - Threshold for PPR calculation stopping
criterion (:obj:`edge_weight >= eps * out_degree`).
Recommended default: :obj:`1e-4`.
:rtype: (:class:`LongTensor`, :class:`Tensor`)
"""
Expand Down Expand Up @@ -348,24 +350,23 @@ def sparsify_dense(self, matrix, method, **kwargs):
method (str): Method of sparsification. Options:
1. :obj:`"threshold"`: Remove all edges with weights smaller
than :obj:`eps`.
Additionally expects one of these parameters:
than :obj:`eps`.
Additionally expects one of these parameters:
- **eps** (*float*): Threshold to bound edges at.
- **eps** (*float*) - Threshold to bound edges at.
- **avg_degree** (*int*): If :obj:`eps` is not given,
it can optionally be calculated by calculating the
:obj:`eps` required to achieve a given
:obj:`avg_degree`.
- **avg_degree** (*int*) - If :obj:`eps` is not given,
it can optionally be calculated by calculating the
:obj:`eps` required to achieve a given :obj:`avg_degree`.
2. :obj:`"topk"`: Keep edges with top :obj:`k` edge weights per
node (column).
Additionally expects the following parameters:
node (column).
Additionally expects the following parameters:
- **k** (*int*): Specifies the number of edges to keep.
- **k** (*int*) - Specifies the number of edges to keep.
- **dim** (*int*): The axis along which to take the top
:obj:`k`.
- **dim** (*int*) - The axis along which to take the top
:obj:`k`.
:rtype: (:class:`LongTensor`, :class:`Tensor`)
"""
Expand Down Expand Up @@ -414,18 +415,17 @@ def sparsify_sparse(self, edge_index, edge_weight, num_nodes, method,
edge_index (LongTensor): The edge indices.
edge_weight (Tensor): One-dimensional edge weights.
num_nodes (int): Number of nodes.
method (str): Method of sparsification. Options:
method (str): Method of sparsification:
1. :obj:`"threshold"`: Remove all edges with weights smaller
than :obj:`eps`.
Additionally expects one of these parameters:
than :obj:`eps`.
Additionally expects one of these parameters:
- **eps** (*float*): Threshold to bound edges at.
- **eps** (*float*) - Threshold to bound edges at.
- **avg_degree** (*int*): If :obj:`eps` is not given,
it can optionally be calculated by calculating the
:obj:`eps` required to achieve a given
:obj:`avg_degree`.
- **avg_degree** (*int*) - If :obj:`eps` is not given,
it can optionally be calculated by calculating the
:obj:`eps` required to achieve a given :obj:`avg_degree`.
:rtype: (:class:`LongTensor`, :class:`Tensor`)
"""
Expand Down

0 comments on commit 1d36674

Please sign in to comment.