nichecompass.nn.OneHopSumNodeLabelAggregator
- class nichecompass.nn.OneHopSumNodeLabelAggregator(modality)
One-hop Sum Node Label Aggregator class that sums up the omics features of a node’s 1-hop neighbors to build an aggregated neighbor omics feature vector for a node. It returns a concatenation of the node’s own omics feature vector and the sum-aggregated neighbor omics feature vector as node labels for the omics reconstruction task.
- Parameters:
modality (
Literal['rna','atac']) – Omics modality that is aggregated. Can be eitherrnaoratac.
Methods table
|
Forward pass of the One-hop Sum Node Label Aggregator. |
Methods
- OneHopSumNodeLabelAggregator.forward(x, edge_index, return_agg_weights=False)
Forward pass of the One-hop Sum Node Label Aggregator.
- Parameters:
x (
Tensor) – Tensor containing the omics features of the nodes in the current node batch including sampled neighbors. (Size: n_nodes_batch_and_sampled_neighbors x n_node_features)edge_index (
Tensor) – Tensor containing the node indices of edges in the current node batch including sampled neighbors. (Size: 2 x n_edges_batch_and_sampled_neighbors)
- Return type:
Tensor- Returns:
x_neighbors: Tensor containing the node labels of the nodes in the current node batch excluding sampled neighbors. These labels are used for the omics reconstruction task. (Size: n_nodes_batch x (2 x n_node_features))