Skip to content

Commit 904a465

Browse files
committed
add classification implementation
1 parent 5367f44 commit 904a465

File tree

7 files changed

+36
-742
lines changed

7 files changed

+36
-742
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "classification"]
2+
path = classification
3+
url = https://github.com/hunto/image_classification_sota.git

README.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
# Knowledge Diffusion for Distillation (DiffKD)
2-
Official implementation for paper "[Knowledge Diffusion for Distillation](https://arxiv.org/abs/2305.15712)" (DiffKD).
2+
Official implementation for paper "[Knowledge Diffusion for Distillation](https://arxiv.org/abs/2305.15712)" (DiffKD), NeurIPS 2023
33

44
---
55

6-
## Updates
7-
### June 9, 2023
8-
We released the core code of DiffKD. See `example.py` for usage.
6+
## Reproducing our results
97

10-
---
8+
```shell
9+
git clone https://github.com/hunto/DiffKD.git --recurse-submodules
10+
cd DiffKD
11+
```
1112

12-
## Reproducing our results
13+
**The implementation of DiffKD is in** [classification/lib/models/losses/diffkd](https://github.com/hunto/image_classification_sota/tree/main/lib/models/losses/diffkd).
1314

14-
**We are refactoring our code and reproducing the results.**
15+
* classification: prepare your environment and datasets following the `README.md` in `classification`.
1516

1617
### ImageNet
1718

18-
* Baseline settings (`R34-R101` and `R50-MBV1`):
19+
```
20+
cd classification
21+
sh tools/dist_train.sh 8 ${CONFIG} ${MODEL} --teacher-model ${T_MODEL} --experiment ${EXP_NAME}
22+
```
23+
24+
Example script for reproducing DiffKD on ResNet-34 teacher and ResNet-18 student with B1 baseline setting:
25+
```
26+
sh tools/dist_train.sh 8 configs/strategies/distill/diffkd/diffkd_b1.yaml tv_resnet18 --teacher-model tv_resnet34 --experiment diffkd_res34_res18
27+
```
28+
29+
* Baseline settings (`R34-R18` and `R50-MBV1`):
1930
```
2031
CONFIG=configs/strategies/distill/TODO
2132
```
@@ -24,3 +35,16 @@ We released the core code of DiffKD. See `example.py` for usage.
2435
|ResNet-18 (69.76)|ResNet-34 (73.31)|72.20|`tv_resnet18`|`tv_resnet34`|[log](https://github.com/hunto/DiffKD/releases/download/v0.0.1/log_b1_diffkd_res34_res18.txt)|[ckpt](https://drive.google.com/file/d/19Wy5RCfpkAg9oUIiDUhfWtl8DjD712DN/view?usp=sharing)|
2536
|MobileNet V1 (70.13)|ResNet-50 (76.16)|73.24|`mobilenet_v1`|`tv_resnet50`|to be reproduced||
2637
38+
39+
## License
40+
This project is released under the [Apache 2.0 license](LICENSE).
41+
42+
## Citation
43+
```
44+
@article{huang2023knowledge,
45+
title={Knowledge Diffusion for Distillation},
46+
author={Huang, Tao and Zhang, Yuan and Zheng, Mingkai and You, Shan and Wang, Fei and Qian, Chen and Xu, Chang},
47+
journal={arXiv preprint arXiv:2305.15712},
48+
year={2023}
49+
}
50+
```

classification

Submodule classification added at 6cb1441

diffkd.py

Lines changed: 0 additions & 82 deletions
This file was deleted.

diffkd_modules.py

Lines changed: 0 additions & 153 deletions
This file was deleted.

example.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)