GemmaTextConditioner<T>

Models & Types · AiDotNet.Diffusion.Conditioning

Gemma text encoder conditioning module (Gemma Team 2024). Pre-LN RMSNorm Transformer stack with RoPE multi-head attention and SiLU FFN. Used by Imagen 3 and other Google diffusion pipelines.

Inheritance: NeuralNetworkBase<T> → TextConditioningBase<T> → GemmaTextConditioner<T>

Constructors

Constructor Summary
GemmaTextConditioner(ITokenizer tokenizer, NeuralNetworkArchitecture<T> architecture, GemmaTextConditionerOptions options)

Properties

Property Summary
bool ProducesPooledOutput { get; }

Methods

Method Summary
GemmaTextConditioner<T> FromPretrained(GemmaVariant variant, string huggingFaceModelName, string cacheDir) Loads a paper-canonical Gemma conditioner with its real pretrained SentencePiece tokenizer from HuggingFace.
Tensor<T> GetPooledEmbedding(Tensor<T> sequenceEmbeddings) Decoder-style models pool by extracting the embedding at the last non-pad token position.