torchcell.models.cell_graph_transformer_metabolism.MetabolomeVectorHead

class MetabolomeVectorHead(hidden_dim: int, output_dim: int, use_gene_pool: bool = True, use_pert_pool: bool = True, dropout: float = 0.1, param_dim: int = 1)[source]

Bases: Module

Whole-cell readout for a FIXED-COLUMN metabolome vector (Mulleder’s 19 AAs).

The columns are the measured metabolite keys in sorted() order – the same order the Perturbation graph processor uses when it flattens the metabolite_level dict – so column k of the output is always the same amino acid. This head does NOT read the Yeast9 metabolite node set and needs no s_NNNN mapping: the measured set is small, dense, and fixed, which is precisely why Track A can skip the metabolite-id alignment that a general per-metabolite readout would require.

forward(h_CLS: Tensor, H_genes_pert: Tensor, pert_pool: Tensor | None = None) → Tensor[source]

Return [batch, F] (point) or [batch, F, param_dim].