r"""Message passing of ``vertices to hyperedges`` 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``): Vertex feature matrix
(
self,
group_name: str,
X: torch.Tensor,
aggr: str = "mean",
v2e_weight: Optional[torch.Tensor] = None,
e_weight: Optional[torch.Tensor] = None,
drop_rate: float = 0.0,
)
| 1481 | return X |
| 1482 | |
| 1483 | def v2e_of_group( |
| 1484 | self, |
| 1485 | group_name: str, |
| 1486 | X: torch.Tensor, |
| 1487 | aggr: str = "mean", |
| 1488 | v2e_weight: Optional[torch.Tensor] = None, |
| 1489 | e_weight: Optional[torch.Tensor] = None, |
| 1490 | drop_rate: float = 0.0, |
| 1491 | ): |
| 1492 | r"""Message passing of ``vertices to hyperedges`` in specified hyperedge group. The combination of ``e2v_aggregation_of_group`` and ``e2v_update_of_group``. |
| 1493 | |
| 1494 | Args: |
| 1495 | ``group_name`` (``str``): The specified hyperedge group. |
| 1496 | ``X`` (``torch.Tensor``): Vertex feature matrix. Size :math:`(|\mathcal{V}|, C)`. |
| 1497 | ``aggr`` (``str``): The aggregation method. Can be ``'mean'``, ``'sum'`` and ``'softmax_then_sum'``. |
| 1498 | ``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``. |
| 1499 | ``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``. |
| 1500 | ``drop_rate`` (``float``): Dropout rate. Randomly dropout the connections in incidence matrix with probability ``drop_rate``. Default: ``0.0``. |
| 1501 | """ |
| 1502 | assert ( |
| 1503 | group_name in self.group_names |
| 1504 | ), f"The specified {group_name} is not in existing hyperedge groups." |
| 1505 | X = self.v2e_aggregation_of_group( |
| 1506 | group_name, X, aggr, v2e_weight, drop_rate=drop_rate |
| 1507 | ) |
| 1508 | X = self.v2e_update_of_group(group_name, X, e_weight) |
| 1509 | return X |
| 1510 | |
| 1511 | def e2v_aggregation( |
| 1512 | self, |
no test coverage detected