VAR is trained with a standard cross-entropy loss on every token of every scale. When the paper studies scaling it reports two numbers for the test loss and for the token error rate (the share of tokens whose most likely prediction is wrong): one for the last scale only, the final full-resolution map, and one for the global average over the whole multi-scale sequence. Compute all of them from a model's logits.
scale_losses(logits, maps)
maps are the target token maps (2-D integer arrays or nested lists of shapes ).logits has shape with . Its rows follow the training layout: all tokens of row-major, then all tokens of , and so on."L_avg": the mean loss over all tokens,"L_last": the mean loss over the tokens of ,"Err_avg" and "Err_last": the same two averages of the error indicator,"per_scale": the list of mean losses, one per scale.ValueError if the number of logit rows is not . Large logits (around 1000) must not overflow.