Masking primitives for self-supervised objectives #
This file gives a small finite-index vocabulary for masked prediction objectives. It stays
independent of any particular image or transformer implementation: a patch/token collection is just
Fin n → α, and a mask is a Boolean predicate on Fin n.
The definitions make MAE/JEPA-style objectives precise enough for local invariants before they are connected to larger executable models.
A finite mask over n patches/tokens. true means the index is selected.
Instances For
The all-visible/all-target mask.
Instances For
Mask selecting no positions.
Instances For
Pointwise Boolean complement of a mask.
Instances For
Complementing a mask negates selection pointwise. This supports a context/target partition when the caller chooses complementary masks; the objective definitions do not enforce that choice.
Generic masked loss over an explicit array of selected indices.
The scalar loss is Nat, so this models natural-valued scores such as quantized patch losses.
Each array occurrence contributes once; duplicate indices are not removed.
Instances For
An empty index array contributes no loss.
Zero per-patch loss at every selected index gives zero total loss. This theorem states only that direction; it does not assume the per-patch score characterizes perfect reconstruction.