main function
void
main()
Implementation
void main() {
print("--- Advanced Transformer Examples ---");
// Example 1: Inspecting a single SelfAttention head
exampleSelfAttention();
// Example 2: Verifying MultiHeadAttention output shape
exampleMultiHeadAttention();
// Example 3: Demonstrating Layer Normalization
exampleLayerNorm();
// Example 4: Using ValueMatrix for a custom operation (if needed)
exampleValueMatrix();
// Example 5: Training a Transformer with a larger vocabulary and sequence
exampleLargerTransformerTraining();
// Example 6: Generating a sequence (simplified, as full text generation is complex)
exampleSequenceGeneration();
}