BEiT
BEiT: BERT Pre-Training of Image Transformers
Hangbo Bao, Li Dong, Songhao Piao, Furu Wei · ICLR 2022
Tokenize images into discrete visual codes and predict labels only at masked positions.
What you will implement
Implement discrete-token cross-entropy on a sparse mask with correct reduction and gradients.
- 183. BEiT Masked Discrete Visual Token Prediction
Select masked patch logits and compute stable cross-entropy against fixed discrete visual token IDs.
Implement the loss core with supplied token IDs; a CPU experiment learns a shared token head without training a tokenizer or ViT.