Semantic RF records¶
Maturity: verified
The canonical bundle is a storage contract. The model consumes tensors. Between them, RFFM uses immutable semantic records so data identity, physical metadata, labels, and tensor shapes are validated before input preparation.
Sample¶
RFSample
contains:
iq: NumPyfloat32with shape(2, T), ordered I then Q;label: a mapping, empty when no label is present;metadata: sample rate plus optional center frequency, bandwidth, signal-to-noise ratio, and dataset-specific attributes;provenance: dataset name, dataset snapshot identity, sample ID, and optional source URI;split: one canonicaltrain,val, ortestvalue.
The constructor rejects the wrong dtype, channel order, dimensionality, or missing provenance identity.
Batch¶
rf_collate
right-pads samples into
RFBatch:
iq:(B, 2, T_max)float tensor;mask:(B, T_max)boolean tensor, true only for real I/Q positions;sample_ids: canonical IDs in row order;split: one value shared by the complete batch;labels: numeric columns become tensors; other values remain tuples;metadata: heterogeneous columns remain row-ordered tuples.
Collation rejects empty input, mixed splits, inconsistent label keys, or misaligned batch dimensions. It does not normalize, patch, tokenize, or invent a label vocabulary.
Prepared model input¶
prepare_iq_input
turns one semantic batch into IQModelInput:
normalized I/Q
(B, 2, T)and amplitude scale(B, 1, 1);flattened patches and element masks
(B, N, 2P);patch mask
(B, N);physical metadata values and masks
(B, 3)in sample-rate, center-frequency, bandwidth order;sample IDs and a patch trace for each row.
Amplitude normalization runs before padding and patching, so right-padding does not change a sample’s scale. Missing physical metadata remains zero with a false mask.
Split identity¶
SplitInfo
carries the split name, sample count, and a SHA-256 fingerprint of
the dataset identity, ordered split membership, and artifact checksums. It is
an immutable content identity, not a manually assigned compatibility version.