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

Method v2e

easygraph/classes/hypergraph.py:1462–1481  ·  view source on GitHub ↗

r"""Message passing of ``vertices to hyperedges``. The combination of ``v2e_aggregation`` and ``v2e_update``. Args: ``X`` (``torch.Tensor``): Vertex feature matrix. Size :math:`(|\mathcal{V}|, C)`. ``aggr`` (``str``): The aggregation method. Can be ``'mean'``, ``'sum

(
        self,
        X: torch.Tensor,
        aggr: str = "mean",
        v2e_weight: Optional[torch.Tensor] = None,
        e_weight: Optional[torch.Tensor] = None,
        drop_rate: float = 0.0,
    )

Source from the content-addressed store, hash-verified

1460 return X
1461
1462 def v2e(
1463 self,
1464 X: torch.Tensor,
1465 aggr: str = "mean",
1466 v2e_weight: Optional[torch.Tensor] = None,
1467 e_weight: Optional[torch.Tensor] = None,
1468 drop_rate: float = 0.0,
1469 ):
1470 r"""Message passing of ``vertices to hyperedges``. The combination of ``v2e_aggregation`` and ``v2e_update``.
1471
1472 Args:
1473 ``X`` (``torch.Tensor``): Vertex feature matrix. Size :math:`(|\mathcal{V}|, C)`.
1474 ``aggr`` (``str``): The aggregation method. Can be ``'mean'``, ``'sum'`` and ``'softmax_then_sum'``.
1475 ``v2e_weight`` (``torch.Tensor``, optional): The weight vector attached to connections (vertices point to hyepredges). If not specified, the function will use the weights specified in hypergraph construction. Defaults to ``None``.
1476 ``e_weight`` (``torch.Tensor``, optional): The hyperedge weight vector. If not specified, the function will use the weights specified in hypergraph construction. Defaults to ``None``.
1477 ``drop_rate`` (``float``): Dropout rate. Randomly dropout the connections in incidence matrix with probability ``drop_rate``. Default: ``0.0``.
1478 """
1479 X = self.v2e_aggregation(X, aggr, v2e_weight, drop_rate=drop_rate)
1480 X = self.v2e_update(X, e_weight)
1481 return X
1482
1483 def v2e_of_group(
1484 self,

Callers 1

v2vMethod · 0.95

Calls 2

v2e_aggregationMethod · 0.95
v2e_updateMethod · 0.95

Tested by

no test coverage detected