Views
No views yet
state_dict_emamodel.safetensors1import torch
2from timm.models import create_model
3
4# Run from the ThinkingViT repository root, or put this repository on PYTHONPATH.
5model = create_model("hf-hub:alihjt/thinkingvit-swin-s-imagenet1k", pretrained=True)
6model.eval()
7
8x = torch.randn(1, 3, 224, 224)
9with torch.no_grad():
10 logits, stage = model(x, threshold=1.0)
11print(logits.shape, stage)| Threshold | Acc@1 (%) | GMACs |
|---|---|---|
| 0.0 | 83.516 | 11.68 |
| 0.5 | 83.386 | 6.76 |
| 1.0 | 82.124 | 4.88 |
| 1.6 | 79.746 | 3.53 |
| 5.0 | 77.990 | 2.82 |