torchcell.models.hetero_cell_bipartite_dango_gi_lazy.GeneInteractionDango
- class GeneInteractionDango(gene_num: int, hidden_channels: int, num_layers: int, gene_multigraph: GeneMultiGraph, dropout: float = 0.1, norm: str = 'layer', activation: str = 'relu', gene_encoder_config: dict[str, Any] | None = None, local_predictor_config: dict[str, Any] | None = None)[source]
Bases:
ModuleLazy Dango-style model predicting gene interactions from a gene multigraph.
- forward_single(data: HeteroData | Batch) Tensor[source]
Process graph data with full node/edge tensors and masking (lazy version).
Key differences from original: - No node filtering: x references FULL graph (all nodes including perturbed) - Masking happens during message passing (via edge masks) - Returns full graph embeddings [total_nodes, hidden_dim]
- Parameters:
data – HeteroData or Batch with LazySubgraphRepresentation format
- Returns:
Full graph embeddings [total_nodes, hidden_dim]
- forward(cell_graph: HeteroData, batch: HeteroData) tuple[Tensor, dict[str, Tensor]][source]
Run the forward pass with mask application before aggregation (lazy version).
Key differences from original: - z_w and z_i are full graph embeddings [total_nodes, hidden_dim] - Apply pert_mask before global aggregation (only aggregate kept genes) - perturbation_indices work unchanged (index into full graph)