Fix README with proper formatting and download links
Browse files
README.md
CHANGED
|
@@ -27,10 +27,10 @@ All models use **W2A8** (2-bit weights, 8-bit activations) with 100% ternary cov
|
|
| 27 |
|
| 28 |
| Model | Phase | Epochs | Top-1 (%) | Size (MB) | Compression | Checkpoint |
|
| 29 |
|-------|-------|--------|-----------|-----------|-------------|------------|
|
| 30 |
-
| DeiT-Small | Phase 1 | 250 | 75.05 | 5.81 | 15.
|
| 31 |
-
| DeiT-III-Small | Phase 1 | 250 | 76.78 | 5.81 | 15.
|
| 32 |
-
| DeiT-Small | Phase 2 | +10 | **77.47** | 5.81 | 15.
|
| 33 |
-
| DeiT-III-Small | Phase 2 | +10 | **79.64** | 5.81 | 15.
|
| 34 |
|
| 35 |
### CIFAR-10 / CIFAR-100
|
| 36 |
|
|
@@ -50,8 +50,32 @@ See the paper for full details.
|
|
| 50 |
|
| 51 |
## Loading a Checkpoint
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
|
|
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
| Model | Phase | Epochs | Top-1 (%) | Size (MB) | Compression | Checkpoint |
|
| 29 |
|-------|-------|--------|-----------|-----------|-------------|------------|
|
| 30 |
+
| DeiT-Small | Phase 1 | 250 | 75.05 | 5.81 | 15.2x | [download](https://huggingface.co/szymonrucinski/FTerViT/resolve/main/imagenet1k/phase1_ep250_acc75.05_deit_small_224.pth) |
|
| 31 |
+
| DeiT-III-Small | Phase 1 | 250 | 76.78 | 5.81 | 15.2x | [download](https://huggingface.co/szymonrucinski/FTerViT/resolve/main/imagenet1k/phase1_ep250_acc76.78_deit3_small_224.pth) |
|
| 32 |
+
| DeiT-Small | Phase 2 | +10 | **77.47** | 5.81 | 15.2x | [download](https://huggingface.co/szymonrucinski/FTerViT/resolve/main/imagenet1k/phase2_ep010_acc77.47_deit_small_224.pth) |
|
| 33 |
+
| DeiT-III-Small | Phase 2 | +10 | **79.64** | 5.81 | 15.2x | [download](https://huggingface.co/szymonrucinski/FTerViT/resolve/main/imagenet1k/phase2_ep010_acc79.64_deit3_small_224.pth) |
|
| 34 |
|
| 35 |
### CIFAR-10 / CIFAR-100
|
| 36 |
|
|
|
|
| 50 |
|
| 51 |
## Loading a Checkpoint
|
| 52 |
|
| 53 |
+
```python
|
| 54 |
+
import timm
|
| 55 |
+
import torch
|
| 56 |
+
from huggingface_hub import hf_hub_download
|
| 57 |
|
| 58 |
+
# 1. Build model and apply ternary conversion
|
| 59 |
+
model = timm.create_model("deit3_small_patch16_224.fb_in22k_ft_in1k", pretrained=False, num_classes=1000)
|
| 60 |
|
| 61 |
+
# Replace Linear -> BitLinear, LayerNorm -> TernaryLayerNorm, Conv2d -> BitConv2d
|
| 62 |
+
# (see repo for ternary conversion utilities)
|
| 63 |
+
|
| 64 |
+
# 2. Download and load checkpoint
|
| 65 |
+
path = hf_hub_download("szymonrucinski/FTerViT", "imagenet1k/phase2_ep010_acc79.64_deit3_small_224.pth")
|
| 66 |
+
state_dict = torch.load(path, map_location="cpu")
|
| 67 |
+
# Strip wrapper prefix if present
|
| 68 |
+
state_dict = {k.removeprefix("timm_model."): v for k, v in state_dict.items()}
|
| 69 |
+
model.load_state_dict(state_dict, strict=False)
|
| 70 |
+
```
|
| 71 |
|
| 72 |
+
## Citation
|
| 73 |
|
| 74 |
+
```bibtex
|
| 75 |
+
@inproceedings{rucinski2026ftervit,
|
| 76 |
+
title={FTerViT: Fully Ternary Vision Transformer},
|
| 77 |
+
author={Ruci{\'n}ski, Szymon and Bonazzi, Pietro and Turetken, Engin and Narduzzi, Simon and Magno, Michele and Maamari, Nadim},
|
| 78 |
+
booktitle={NeurIPS},
|
| 79 |
+
year={2026}
|
| 80 |
+
}
|
| 81 |
+
```
|