PE Core t16 classify

Click a block to read its description, or select it with Tab and Enter.

PE Core t16 classifyImage input 384 × 384, text length 32. Classify example: 3 classes, one prompt each. Tensor sizes exclude batch.LibreYOLOPE Core t16 classifyImage input 384 × 384, text length 32. Classify example: 3 classes, one prompt each. Tensor sizes exclude batch.Image towerImage3 × 384 × 384Conv2d 16×16 / 16192 channels, bias=FalseFlatten patch grid576 × 192Learned CLS1 × 192Concat CLS and patches577 × 192Position embedding577 × 192+LayerNorm before encoder577 × 192Vision encoder block577 × 192, repeats=12LayerNorm after encoder577 × 192Latent attention pooling1 query, 8 pooling headsLinear projection192 to 512, bias=TrueL2 normalize512RoPE applies to patch Q/K in every block.g14 has no CLS token; other sizes have one.Text towerText token IDs32 IDs, vocabulary 49,408Token embedding32 × 512Embedded sequence32 × 512Position embedding32 × 512+Text transformer block32 × 512, repeats=12Final LayerNorm32 × 512Select EOTArgmax token ID, width 512MatMul projection512 to 512, no biasL2 normalize512Task outputImage vector512Class matrix3 × 512MatMul cosine similarity3 scoresMultiply exp(logit_scale)3 logitsPrediction applies softmax over the class set.Image vector: task outputText vector: task outputLatent attention poolingLearned latent1 × 192Cross-attention1 query over 577 image tokensLayerNorm1 × 192Linear192 to 768GELU1 × 768Linear768 to 192+Select pooled token192Pooling cross-attentionQuery input1 × 192Key/value input577 × 192Linear Q192 to 192Reshape heads8 × 1 × 24Linear K192 to 192Reshape heads8 × 577 × 24Linear V192 to 192Reshape heads8 × 577 × 24MatMul Q K-transpose8 × 1 × 577ScaleDivide by sqrt(24)Softmax over keys8 × 1 × 577MatMul attention × V8 × 1 × 24Merge heads1 × 192Linear output192 to 192Vision encoder blockInput 577 × 192LayerNorm577 × 192Multi-head self-attention3 heads+LayerNorm577 × 192Linear192 to 768GELU577 × 768Linear768 to 192+Output 577 × 192Vision rotary self-attentionQuery input577 × 192Key/value input577 × 192Linear Q192 to 192Reshape heads3 × 577 × 64Linear K192 to 192Reshape heads3 × 577 × 64Linear V192 to 192Reshape heads3 × 577 × 64Rotary position1 prefix; rotate patchesRotary position1 prefix; rotate patchesMatMul Q K-transpose3 × 577 × 577ScaleDivide by sqrt(64)Softmax over keys3 × 577 × 577MatMul attention × V3 × 577 × 64Merge heads577 × 192Linear output192 to 192Text transformer blockInput 32 × 512LayerNorm32 × 512Multi-head self-attention8 heads+LayerNorm32 × 512Linear512 to 2048GELU32 × 2048Linear2048 to 512+Output 32 × 512Text causal self-attentionQuery input32 × 512Key/value input32 × 512Linear Q512 to 512Reshape heads8 × 32 × 64Linear K512 to 512Reshape heads8 × 32 × 64Linear V512 to 512Reshape heads8 × 32 × 64MatMul Q K-transpose8 × 32 × 32ScaleDivide by sqrt(64)Causal mask32 × 32+Softmax over keys8 × 32 × 32MatMul attention × V8 × 32 × 64Merge heads32 × 512Linear output512 to 512Rotary position on Q and KQ or K per head576 patch tokens, 64 channelsPrefix bypass1 CLS token; no rotationPair adjacent channels[a,b] becomes [-b,a]Cosine table2D grid offset 1.0Sine tableSame spatial frequency gridMultiply input × cos576 × 64Multiply rotation × sin576 × 64+Concat preserved CLS and rotated patchesRestore the original token orderNo RoPE on V. Frequency base 10,000; XY grid. Family Np = Nv - 1.Video embeddingTwo input frames2 × 3 × 384 × 384Image tower per frame2 × 512, before L2 normalizationMean frame embeddings512L2 normalize once512Example uses two frames; encode_video accepts arbitrary frame count F.No temporal attention is added. Frame embeddings are averaged before normalization.Variant valuesSizeS / PNvEv / nv / hvMvEt / nt / htLDt16384 / 16577192 / 12 / 3768512 / 12 / 832512s16384 / 16577384 / 12 / 61536512 / 12 / 832512b16224 / 16197768 / 12 / 1230721024 / 24 / 16321024l14336 / 145771024 / 24 / 1640961024 / 24 / 16321024g14448 / 1410241536 / 50 / 1689601280 / 24 / 20721280S/P: input/patch size. Nv: image tokens. Ev/Et: tower width. nv/nt: block counts. hv/ht: heads. Mv: vision MLP width.The symbolic graph covers t16, s16, b16, l14. g14 has a separate concrete graph because its CLS path is absent.Source: libreyolo/models/pe/nn.py. Revision a4d0ecc9e17f.libreyolo.com