Models#

The deepspatial.models module contains the GiT network used to predict joint spatial, gene-expression, and cell-type velocity fields. Cell type enters GiT as a continuously relaxed one-hot vector, not as a discrete embedding lookup.

Main Architecture#

The primary transformer-based backbone responsible for learning the multimodal continuous vector fields. Coordinates are projected with Linear(2, H), gene-expression patches use a two-layer MLP embedder, and the $K$-dimensional cell-type state uses Linear(K, H) as global conditioning. GiT does not use a two-layer spatial MLP or nn.Embedding for cell type.

GiT

GiT: Generative Transformer for joint spatial, expression, and cell-type velocities.

Building Blocks#

The internal neural network components used to construct the GiT model, including modality-specific embedders and Adaptive Layer Normalization (adaLN-Zero) transformer blocks.

GiTBlock

Transformer block with adaptive layer normalization (adaLN-Zero) conditioning.

PatchEmbedder

Embeds 1D vectors (e.g., gene expressions) into patch tokens via an MLP.