xnn.transformer#

Transformer building blocks shared by attention-based potentials.

This family package holds the pieces that graph-transformer potentials reuse regardless of the rest of their architecture:

  • ExpNormalSmearing – the TorchMD-Net exponential-normal radial basis (also used by ET / TensorNet / BAMBOO);

  • EdgeMultiheadAttention – a multi-head QKV attention on graph edges (the shared attention primitive of the BAMBOO graph-equivariant transformer, factored out so future transformer-based models can build on it).

The concrete hybrid GNN+transformer model that consumes these lives under xnn.hybrid (see xnn.hybrid.models.bamboo.BAMBOO).

Modules

attention

Multi-head QKV attention on graph edges.

featurizers

Radial featurizers for transformer-based potentials.