torchcell.nn.stoichiometric_hypergraph_conv.StoichHypergraphConv

class StoichHypergraphConv(in_channels: int, out_channels: int, is_stoich_gated: bool = False, use_attention: bool = False, attention_mode: str = 'node', heads: int = 1, concat: bool = True, negative_slope: float = 0.2, dropout: float = 0, bias: bool = True, **kwargs: Any)[source]

Bases: MessagePassing

Hypergraph convolution with optional stoichiometric gating and attention.

reset_parameters() → None[source]

Reinitialize the layer’s linear, attention, and bias parameters.

forward(x: Tensor, edge_index: Tensor, stoich: Tensor, hyperedge_attr: Tensor | None = None, num_edges: int | None = None) → Tensor[source]

Run the stoichiometric hypergraph message-passing forward pass.

message(x_j: Tensor, norm_i: Tensor, alpha: Tensor | None, stoich: Tensor, gate_values: Tensor | None) → Tensor[source]

Compute messages weighted by stoichiometry, attention, and gating.