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

Method e2v_of_group

easygraph/classes/hypergraph.py:1681–1705  ·  view source on GitHub ↗

r"""Message passing of ``hyperedges to vertices`` in specified hyperedge group. The combination of ``e2v_aggregation_of_group`` and ``e2v_update_of_group``. Args: ``group_name`` (``str``): The specified hyperedge group. ``X`` (``torch.Tensor``): Hyperedge feature mat

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

Source from the content-addressed store, hash-verified

1679 return X
1680
1681 def e2v_of_group(
1682 self,
1683 group_name: str,
1684 X: torch.Tensor,
1685 aggr: str = "mean",
1686 e2v_weight: Optional[torch.Tensor] = None,
1687 drop_rate: float = 0.0,
1688 ):
1689 r"""Message passing of ``hyperedges to vertices`` in specified hyperedge group. The combination of ``e2v_aggregation_of_group`` and ``e2v_update_of_group``.
1690
1691 Args:
1692 ``group_name`` (``str``): The specified hyperedge group.
1693 ``X`` (``torch.Tensor``): Hyperedge feature matrix. Size :math:`(|\mathcal{E}|, C)`.
1694 ``aggr`` (``str``): The aggregation method. Can be ``'mean'``, ``'sum'`` and ``'softmax_then_sum'``.
1695 ``e2v_weight`` (``torch.Tensor``, optional): The weight vector attached to connections (hyperedges point to vertices). If not specified, the function will use the weights specified in hypergraph construction. Defaults to ``None``.
1696 ``drop_rate`` (``float``): Dropout rate. Randomly dropout the connections in incidence matrix with probability ``drop_rate``. Default: ``0.0``.
1697 """
1698 assert (
1699 group_name in self.group_names
1700 ), f"The specified {group_name} is not in existing hyperedge groups."
1701 X = self.e2v_aggregation_of_group(
1702 group_name, X, aggr, e2v_weight, drop_rate=drop_rate
1703 )
1704 X = self.e2v_update_of_group(group_name, X)
1705 return X
1706
1707 def v2v(
1708 self,

Callers 1

v2v_of_groupMethod · 0.95

Calls 2

e2v_update_of_groupMethod · 0.95

Tested by

no test coverage detected