Repository navigation
v0.113.0: CLS classification pooling
CLS classification pooling
Opt into a learned class token with training.classification.pooling: "cls".
A trainable cls_token of shape [1, model_dim] is prepended after the input
adapter and before positional embeddings, and the classifier reads position
zero after final normalization.
seq_lenandbatch_tokenskeep their loader meanings. The backbone runs at
seq_len + 1; learned positional capacity defaults to that longer length, and
an explicitmax_positionsmust cover it.- Supported for token embeddings,
linear_frames, anddiscrete_codebooks
inputs over bidirectionalplainattention, optionally composed withmlp,
swiglu,geglu, ormoe. Causal/recurrent mixers, FFN-only stacks,
BatchNorm, RC equivariance, and embedding side channels are rejected with a
clear error until they have dedicated coverage. - Padding masks gain a valid CLS entry inside the graph, so loader and runtime
input shapes are unchanged and padded batches agree with unpadded ones. - The class token initializes from Normal(0, 0.02);
training.weight_init: "normal"usestraining.weight_init_stdinstead. - Hugging Face export carries the token, the extra learned-position row, and the
padding-aware mask. Native vs. Transformers max logit error is 7.15e-7
(linear_frames) and 2.38e-7 (tokens). Codebook adapters remain native-only.
Existing mean and last pooling layouts are untouched, so current
checkpoints load unchanged. Switching pooling mode is not checkpoint-compatible.
New example: examples/cls_frames_classifier.json
Other Changes
- feat: publish Docker Hub overviews and short descriptions for the app and
CUDA layers directly from the repo, correcting understated GPU support - fix: the Docker Hub overview sync reuses the push step's secret binding
- refactor: class-token initialization dispatches on a weight-meta init mode
rather than a literal tensor name, matching every other special initializer
Install
brew install mrothroc/tap/mixlabOr build from source:
CGO_ENABLED=1 go build -tags mlx -o mixlab ./cmd/mixlab/