MCPcopy Create free account
hub / github.com/easy-graph/Easy-Graph / smoothing_with_GCN

Method smoothing_with_GCN

easygraph/classes/graph.py:498–509  ·  view source on GitHub ↗

r"""Return the smoothed feature matrix with GCN Laplacian matrix :math:`\mathcal{L}_{GCN}`. Args: ``X`` (``torch.Tensor``): Vertex feature matrix. Size :math:`(|\mathcal{V}|, C)`. ``drop_rate`` (``float``): Dropout rate. Randomly dropout the connections in adjacency

(self, X, drop_rate=0.0)

Source from the content-addressed store, hash-verified

496 return self.cache["L_GCN"]
497
498 def smoothing_with_GCN(self, X, drop_rate=0.0):
499 r"""Return the smoothed feature matrix with GCN Laplacian matrix :math:`\mathcal{L}_{GCN}`.
500
501 Args:
502 ``X`` (``torch.Tensor``): Vertex feature matrix. Size :math:`(|\mathcal{V}|, C)`.
503 ``drop_rate`` (``float``): Dropout rate. Randomly dropout the connections in adjacency matrix with probability ``drop_rate``. Default: ``0.0``.
504 """
505 if drop_rate > 0.0:
506 L_GCN = sparse_dropout(self.L_GCN, drop_rate)
507 else:
508 L_GCN = self.L_GCN
509 return L_GCN.mm(X)
510
511 def number_of_edges(self, u=None, v=None):
512 """Returns the number of edges between two nodes.

Callers 1

forwardMethod · 0.80

Calls 1

sparse_dropoutFunction · 0.90

Tested by

no test coverage detected