Vector
Use Vector for a fixed-width numeric representation supplied by another system, such as an embedding or sensor window. Use Text when relflow should encode strings, or Branch for repeated objects.
embedding: [0.12, -0.03, 0.44, 0.08]import relflow as rf
embedding = rf.Vector(n_dim=4, objective="l2", jitter=rf.Jitter(add=0.02))Input and options
Each valued input must be an Arrow list or fixed-size list with exactly n_dim numeric, non-null elements. Values convert to float32. A null vector is a separate field state; null elements inside a valued vector are invalid. relflow does not fit a vector normalizer: prepare coordinate scales upstream.
| Option | Default | Meaning |
|---|---|---|
n_dim |
required | Positive vector width. |
jitter |
rf.Jitter() |
Training noise in supplied coordinate units. |
objective |
"l2" |
Reconstruction loss: "l1" or "l2". |
Jitter changes finite coordinates of valued training inputs before projection. Targets remain pristine. Both settings of jitter.normalize use the same coordinate space; see Jitter.
Learning and output
Reconstruction combines state cross entropy with content loss on valued targets. MAE and RMSE metrics use the supplied coordinate scale.
Prediction content is fixed_size_list<float32>[n_dim]. When the most likely predicted state is non-valued, the writer emits a zero vector. Zeros therefore do not establish whether a vector was observed; read the shared state and inferred members in the prediction envelope.
Use shared leaf options to make the vector a target or export a contextual embedding. That exported embedding has the model width and is distinct from the supplied vector.