Models#

The deepspatial.models module contains the core neural network architectures that power the Flow Matching continuous mapping. It features the GiT network, which is specifically designed to simultaneously process spatial coordinates, high-dimensional gene expressions, and categorical cell types under physical Z-depth conditioning.

Main Architecture#

The primary transformer-based backbone responsible for learning the multi-modal continuous vector fields.

GiT

GiT: Generative Transformer with separated streams for spatial transcriptomics.

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.