Instructions to use anchitya/vit-cifar100-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use anchitya/vit-cifar100-lora with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
|
Download README.md from anchitya/vit-cifar100-lora: direct link, hf CLI and curl.
- Browser
- Download file 1.53 kB
-
https://huggingface.co/anchitya/vit-cifar100-lora/resolve/main/README.md
- Command line
-
hf download hf://anchitya/vit-cifar100-lora/README.md
-
curl -L -o README.md https://huggingface.co/anchitya/vit-cifar100-lora/resolve/main/README.md
1.53 kB
metadata
license: mit
tags:
- image-classification
- vision-transformer
- cifar-100
- lora
- peft
- fine-tuning
datasets:
- cifar100
metrics:
- accuracy
model-index:
- name: ViT-S-CIFAR100-LoRA
results:
- task:
type: image-classification
dataset:
name: CIFAR-100
type: cifar100
metrics:
- name: Accuracy
type: accuracy
value: 88.26
ViT-S Fine-tuned on CIFAR-100 with LoRA
This model is a Vision Transformer Small (ViT-S/16) pretrained on ImageNet and fine-tuned on CIFAR-100 using LoRA (Low-Rank Adaptation) via the PEFT library.
Model Details
- Base Model:
vit_small_patch16_224(timm) - Dataset: CIFAR-100 (100 classes)
- Fine-tuning Method: LoRA (PEFT)
- LoRA Configuration:
- Rank: 8
- Alpha: 8
- Dropout: 0.1
- Target Modules: QKV attention weights
Training Details
- Epochs: 10
- Batch Size: 16
- Learning Rate: 0.0001
- Optimizer: AdamW
- Scheduler: Cosine Annealing with Warmup
Results
- Best Validation Accuracy: 88.26%
Usage
import timm
from peft import PeftModel, LoraConfig
import torch
# Load base model
base_model = timm.create_model('vit_small_patch16_224', pretrained=True, num_classes=100)
# Load fine-tuned weights
checkpoint = torch.load('best_model.pth', map_location='cpu')
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()
Assignment Info
This model was trained as part of DLops Assignment 5.