SigLIP2 b16 classify
Fit diagram
Read at 100%
Clear selection
Download SVG
Download PNG
Click a block to read its description, or select it with Tab and Enter.
SigLIP2 b16 classify
Image input 256 × 256; text length 64. Classify example: 3 classes, one prompt each. Fixed-resolution SigLIP graph.
LibreYOLO
SigLIP2 b16 classify
Image input 256 × 256; text length 64. Classify example: 3 classes, one prompt each. Fixed-resolution SigLIP graph.
Image tower
Image
3 × 256 × 256
Conv2d 16×16 / 16
768 × 16 × 16, bias=True
Flatten and transpose
256 × 768
Position embedding
256 × 768
+
Vision encoder block
256 × 768, repeats=12
LayerNorm after encoder
256 × 768
Attention pooling head
256 tokens to 1 token
Select pooled token
768
L2 normalize
768
No CLS token. Convolution uses valid padding.
so400m uses 27 × 27 patches at 384 px.
Text tower
Text token IDs
64 IDs, vocabulary 256,000
Token embedding
64 × 768
Embedded sequence
64 × 768
Position embedding
64 × 768
+
Text encoder block
64 × 768, repeats=12
Final LayerNorm
64 × 768
Select last token
768
Linear projection
768 to 768, bias=True
L2 normalize
768
Bidirectional attention, no padding mask.
Task output
Image vector
768
Class matrix
3 × 768
MatMul cosine similarity
3 scores
Scale and add learned bias
exp(logit_scale) × cosine + logit_bias
Postprocess: softmax by default; optional multi_label=True applies sigmoid.
Image vector: task output
Text vector: task output
Attention pooling head
Learned probe
1 × 768
Cross-attention
Q: probe; K/V: 256 image tokens
LayerNorm
1 × 768
Linear
768 to 3072
GELU (tanh)
1 × 3072
Linear
3072 to 768
+
Select token 0
768
Pooling cross-attention
Query input
1 × 768
Key/value input
256 × 768
Linear Q
768 to 768
Reshape heads
12 × 1 × 64
Linear K
768 to 768
Reshape heads
12 × 256 × 64
Linear V
768 to 768
Reshape heads
12 × 256 × 64
MatMul Q K-transpose
12 × 1 × 256
Scale
Divide by sqrt(64)
Softmax over keys
12 × 1 × 256
MatMul attention × V
12 × 1 × 64
Merge heads
1 × 768
Linear output
768 to 768
Vision encoder block
Input 256 × 768
LayerNorm
256 × 768
Multi-head self-attention
12 heads
+
LayerNorm
256 × 768
Linear
768 to 3072
GELU (tanh)
256 × 3072
Linear
3072 to 768
+
Output 256 × 768
Vision self-attention
Query input
256 × 768
Key/value input
256 × 768
Linear Q
768 to 768
Reshape heads
12 × 256 × 64
Linear K
768 to 768
Reshape heads
12 × 256 × 64
Linear V
768 to 768
Reshape heads
12 × 256 × 64
MatMul Q K-transpose
12 × 256 × 256
Scale
Divide by sqrt(64)
Softmax over keys
12 × 256 × 256
MatMul attention × V
12 × 256 × 64
Merge heads
256 × 768
Linear output
768 to 768
Text encoder block
Input 64 × 768
LayerNorm
64 × 768
Multi-head self-attention
12 heads
+
LayerNorm
64 × 768
Linear
768 to 3072
GELU (tanh)
64 × 3072
Linear
3072 to 768
+
Output 64 × 768
Text self-attention
Query input
64 × 768
Key/value input
64 × 768
Linear Q
768 to 768
Reshape heads
12 × 64 × 64
Linear K
768 to 768
Reshape heads
12 × 64 × 64
Linear V
768 to 768
Reshape heads
12 × 64 × 64
MatMul Q K-transpose
12 × 64 × 64
Scale
Divide by sqrt(64)
Softmax over keys
12 × 64 × 64
MatMul attention × V
12 × 64 × 64
Merge heads
64 × 768
Linear output
768 to 768
Variant values
Size
S
P
N
E = D
n
h
M
Head width
b16
256
16
256
768
12
12
3072
64
so400m
384
14
729
1152
27
16
4304
72
S: image size. P: patch size. N: image tokens. E/D: tower/output width. n: repeats in each tower. h: heads. M: MLP width.
Source: libreyolo/models/siglip2/nn.py. Revision a4d0ecc9e17f.
libreyolo.com