Skip to main content

Module embedding

Module embedding 

Source
Expand description

Experiment embeddings for optical mask + detector frame (ADR-260 §12).

A 32-dimensional L2-normalised embedding is built by concatenating:

The same dimensionality is used for mask-only embeddings (just the histogram, padded to 32 dims with zeros) so every embedding lives in the same inner-product space.

Constants§

EMBED_DIM
Total embedding dimension.
FRAME_BINS
Number of spectrum bins contributed by the frame half.
MASK_BINS
Number of histogram bins contributed by the mask half.

Functions§

experiment_embedding
Build the full 32-dim experiment embedding from a mask + detector frame.
l2_normalize
Normalise a mutable slice to unit L2 norm (in-place). No-op when all-zero.
mask_embedding
Build a mask-only embedding (32 dims: histogram + 16 zeros), L2-normalised.