oa::NnTransformer
Ready-to-train causal language model: token + position embeddings, a stack of Transformer blocks, final normalization, and vocabulary projection. Input token ids are [batch, contextLength]; logits are [batch*contextLength, vocabSize] for all-position next-token training.
Inheritance
public Module
Public Methods
Examples
Constructor & Destructor Documentation
No public source comment is attached to this declaration.
Parameters
inVocabSizeoa::I32—
inContextLengthoa::I32—
inModelWidthoa::I32Default: 32
inHiddenWidthoa::I32Default: 64
inNumLayersoa::I32Default: 1
inNumHeadsoa::I32Default: 1
inEpsoa::F32Default: 1e-5F
Public Method Documentation
No public source comment is attached to this declaration.
Returns
oa::I32The declared return value.
No public source comment is attached to this declaration.
Parameters
inTokensconst oa::Matrix &—
Returns
oa::MatrixThe declared return value.
No public source comment is attached to this declaration.
Returns
oa::I32The declared return value.
No public source comment is attached to this declaration.
Returns
oa::I32The declared return value.
No public source comment is attached to this declaration.
Returns
oa::I32The declared return value.
No public source comment is attached to this declaration.
Returns
oa::I32The declared return value.