VILAU<T>
Models & Types · AiDotNet.VisionLanguage.InstructionTuned
VILA-U: unified VLM with autoregressive visual generation and understanding.
Inheritance: NeuralNetworkBase<T> → VisionLanguageModelBase<T> → VILAU<T>
Implements: IInstructionTunedVLM<T>
For Beginners
VILA-U extends VILA to not just understand images but also generate them. Most vision-language models are one-way — they look at images and produce text. VILA-U works both ways: it can analyze an image and describe it, or take a text description and generate an image. It does this by converting images into discrete tokens (like a visual vocabulary) that the language model can both read and write. This unified approach means a single model handles image understanding, text generation, and image generation without needing separate specialized models for each task. Default values follow the original paper settings.
How It Works
VILA-U (NVIDIA, 2024) unifies visual understanding and visual generation in a single autoregressive model. Unlike most VLMs that can only understand images and generate text, VILA-U can also generate images autoregressively by predicting visual tokens one at a time. It uses a discrete visual tokenizer to convert images into a sequence of tokens that the language model can both consume (for understanding) and produce (for generation), creating a truly unified visual-linguistic model.
References:
- Paper: “VILA-U: a Unified Foundation Model Integrating Visual Understanding and Generation” (NVIDIA, 2024)
Example
// Create a VILA-U model for unified visual understanding and generation
// using autoregressive visual token prediction
var architecture = new NeuralNetworkArchitecture<double>(
inputType: InputType.TwoDimensional,
taskType: NeuralNetworkTaskType.ImageClassification,
inputHeight: 224, inputWidth: 224, inputDepth: 3, outputSize: 512);
// ONNX inference mode with pre-trained model
var model = new VILAU<double>(architecture, "vilau.onnx");
// Training mode with native layers
var trainModel = new VILAU<double>(architecture, new VILAUOptions());
Constructors
| Constructor | Summary |
|---|---|
VILAU(NeuralNetworkArchitecture<T> architecture, VILAUOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer) |
|
VILAU(NeuralNetworkArchitecture<T> architecture, string modelPath, VILAUOptions options) |
Properties
| Property | Summary |
|---|---|
int DecoderEmbeddingDim { get; } |
|
int EmbeddingDimension { get; } |
|
int MaxGenerationLength { get; } |
|
string LanguageModelName { get; } |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
|
Tensor<T> Chat(Tensor<T> image, IEnumerable<ValueTuple<string, string>> conversationHistory, string userMessage) |
|
Tensor<T> EncodeImage(Tensor<T> image) |
|
Tensor<T> GenerateFromImage(Tensor<T> image, string prompt) |
Generates text using VILA-U’s unified understanding and generation architecture. |