Representation And Model Families¶
This tutorial sketches a heterogeneous representation pipeline and shows how it connects to model families.
The example record has two modalities:
text describing an event;
a numeric signal observed around the same event.
Optional Quantization¶
If the downstream model needs discrete ids, learn a codebook in the shared embedding space.
from mixle.represent import VectorQuantizer
vectors, _ = encoder.encode_numpy(record)
codebook = VectorQuantizer(num_codes=256, dim=64).fit(vectors)
token_ids = codebook.quantize(vectors)
Quantization is optional. It is most useful for compression, enumeration, discrete language-model style training, and stable production artifacts.
Choose A Model Family¶
Once the representation exists, choose the model family based on the modeling
question. Prefer stable mixle.stats families when they fit; use
mixle.models helpers when the applied family is specifically needed and
you are ready to validate it.
Question |
Candidate |
|---|---|
What token or event comes next? |
Incubating |
What continuous response follows from features? |
Applied helpers such as |
Are there unknown clusters? |
|
Is there a latent regime over time? |
HMMs in HMMs and Latent Structure. |
Are event times self-exciting? |
Process models in Temporal And Stochastic Processes. |
Is the output a structured decision? |
Relations in Relations. |
The representation layer should not decide the modeling story by itself. It should preserve evidence in a form that lets the right model family use it.
Practical Checks¶
Before committing to a representation:
verify that each modality produces the expected number of units;
check vector dimensions before registering encoders;
inspect quantization reconstruction error if a codebook is used;
hold out data before comparing representation choices;
keep the representation config with the fitted model artifact.