Views
No views yet
classifier_head.pth)| Item | Description |
|---|---|
| Base model | google/vit-base-patch16-224 or ViT-Large-16 (depending on your version) |
| Task | ImageNet-1K classification |
| Dataset | ILSVRC 2012 ImageNet-1K |
| Training method | PEFT LoRA (r=32), applied to Q/K/V/O + MLP |
| Trainable params | ~2% of total parameters |
| Final accuracy | Top-1 ≈ 71% |
| Resolution | 224×224 |
| Optimizer | AdamW |
| Mixed precision | bf16 / fp16 |
| Data augmentations | RandAugment, Mixup, CutMix, RandomResizedCrop |
1from transformers import ViTForImageClassification
2from peft import PeftModel
3import torch1base = ViTForImageClassification.from_pretrained(
2 "google/vit-base-patch16-224"
3)1model = PeftModel.from_pretrained(
2 base,
3 "username/repo-name"
4)1state = torch.load("classifier_head.pth", map_location="cpu")
2model.base_model.model.classifier.load_state_dict(state)
3model.eval()1{
2 "r": 32,
3 "lora_alpha": 32,
4 "lora_dropout": 0.05,
5 "target_modules": [
6 "query", "key", "value", "output.dense",
7 "intermediate.dense", "output.dense"
8 ]
9}| Metric | Value |
|---|---|
| Top-1 Accuracy | ~71% |
| Top-5 Accuracy | optional |
adapter_model.safetensors # LoRA weights
adapter_config.json # LoRA configuration
classifier_head.pth # Final classification head
README.md # This model card1@article{hu2021lora,
2 title={LoRA: Low-Rank Adaptation of Large Language Models},
3 author={Hu, Edward J. and others},
4 year={2021}
5}
6
7@article{dosovitskiy2020vit,
8 title={An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale},
9 author={Dosovitskiy, Alexey and others},
10 year={2020}
11}