Skip to content

Commit d0849a4

Browse files
authored
Use raw strings with TeX (#657)
Some instances of docstrings using TeX were incorrectly specified as ordinary strings, leading to the TeX macros being interpreted as escape sequences.
1 parent 24ad25c commit d0849a4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ot/gnn/_layers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TFGWPooling(nn.Module):
5959
"""
6060

6161
def __init__(self, n_features, n_tplt=2, n_tplt_nodes=2, alpha=None, train_node_weights=True, multi_alpha=False, feature_init_mean=0., feature_init_std=1.):
62-
"""
62+
r"""
6363
Template Fused Gromov-Wasserstein (TFGW) layer. This layer is a pooling layer for graph neural networks.
6464
Computes the fused Gromov-Wasserstein distances between the graph and a set of templates.
6565
@@ -186,7 +186,7 @@ class TWPooling(nn.Module):
186186
"""
187187

188188
def __init__(self, n_features, n_tplt=2, n_tplt_nodes=2, train_node_weights=True, feature_init_mean=0., feature_init_std=1.):
189-
"""
189+
r"""
190190
Template Wasserstein (TW) layer, also kown as OT-GNN layer. This layer is a pooling layer for graph neural networks.
191191
Computes the Wasserstein distances between the features of the graph features and a set of templates.
192192

ot/gromov/_quantized.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def quantized_fused_gromov_wasserstein_partitioned(
230230

231231
def get_graph_partition(C, npart, part_method='random', F=None, alpha=1.,
232232
random_state=0, nx=None):
233-
"""
233+
r"""
234234
Partitioning a given graph with structure matrix :math:`\mathbf{C} \in R^{n \times n}`
235235
into `npart` partitions either 'random', or using one of {'louvain', 'fluid'}
236236
algorithms from networkx, or 'spectral' clustering from scikit-learn,
@@ -335,7 +335,7 @@ def get_graph_partition(C, npart, part_method='random', F=None, alpha=1.,
335335

336336

337337
def get_graph_representants(C, part, rep_method='pagerank', random_state=0, nx=None):
338-
"""
338+
r"""
339339
Get representative node for each partition given by :math:`\mathbf{part} \in R^{n}`
340340
of a graph with structure matrix :math:`\mathbf{C} \in R^{n \times n}`.
341341
Selection is either done randomly or using 'pagerank' algorithm from networkx.
@@ -408,7 +408,7 @@ def get_graph_representants(C, part, rep_method='pagerank', random_state=0, nx=N
408408

409409
def format_partitioned_graph(C, p, part, rep_indices, F=None, M=None,
410410
alpha=1., nx=None):
411-
"""
411+
r"""
412412
Format an attributed graph :math:`(\mathbf{C}, \mathbf{F}, \mathbf{p})`
413413
with structure matrix :math:`(\mathbf{C} \in R^{n \times n}`, feature matrix
414414
:math:`(\mathbf{F} \in R^{n \times d}` and node relative importance
@@ -761,7 +761,7 @@ def quantized_fused_gromov_wasserstein(
761761

762762
def get_partition_and_representants_samples(
763763
X, npart, method='kmeans', random_state=0, nx=None):
764-
"""
764+
r"""
765765
Compute `npart` partitions and representants over samples :math:`\mathbf{X} \in R^{n \times d}`
766766
using either a random or a kmeans algorithm.
767767
@@ -854,7 +854,7 @@ def get_partition_and_representants_samples(
854854

855855
def format_partitioned_samples(
856856
X, p, part, rep_indices, F=None, alpha=1., nx=None):
857-
"""
857+
r"""
858858
Format an attributed graph :math:`(\mathbf{D}(\mathbf{X}), \mathbf{F}, \mathbf{p})`
859859
with euclidean structure matrix :math:`(\mathbf{D}(\mathbf{X}) \in R^{n \times n}`,
860860
feature matrix :math:`(\mathbf{F} \in R^{n \times d}` and node relative importance

0 commit comments

Comments
 (0)