Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
VainF authored Sep 6, 2023
1 parent 282a6dc commit f9699f3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions examples/transformers/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Pruning ViT from [Timm](https://github.com/huggingface/pytorch-image-models)

#### Pruning
### Pruning
```bash
bash scripts/prune_timm_vit_b_16.sh
```
Expand All @@ -18,7 +18,7 @@ Base Accuracy: 0.8108, Pruned Accuracy: 0.0033
Saving the pruned model to output/pruned/vit_base_patch16_224_pruned.pth...
```

#### Finetuning
### Finetuning
```bash
bash scripts/finetune_timm_vit_b_16.sh
```
Expand All @@ -38,6 +38,13 @@ Some results:
<img src="https://github.com/VainF/Torch-Pruning/assets/18592211/24de19ff-60aa-4402-94e3-527670ffb55e" width="80%"></img>
</div>

### Which pruner should be used for ViT pruning?

* Pruning a Vision Transformer pre-trained on ImageNet-1K without fine-tuning.
<div align="center">
<img src="https://github.com/VainF/Torch-Pruning/assets/18592211/6f99aa90-259d-41e8-902a-35675a9c9d90" width="45%"></img>
<img src="https://github.com/VainF/Torch-Pruning/assets/18592211/11473499-d28a-434b-a8d6-1a53c4b3b7c0" width="45%"></img>
</div>


## Pruning Other Transformers
Expand Down

0 comments on commit f9699f3

Please sign in to comment.