{"id":13788719,"url":"https://github.com/foolwood/pytorch-slimming","last_synced_at":"2025-04-05T13:09:02.143Z","repository":{"id":59833744,"uuid":"117320702","full_name":"foolwood/pytorch-slimming","owner":"foolwood","description":"Learning Efficient Convolutional Networks through Network Slimming, In ICCV 2017.","archived":false,"fork":false,"pushed_at":"2019-05-13T09:04:47.000Z","size":13,"stargazers_count":570,"open_issues_count":16,"forks_count":96,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-29T12:09:35.285Z","etag":null,"topics":["deep-learning","fast-inference","l1-regularization","pytorch","weight-pruning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foolwood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-13T06:38:28.000Z","updated_at":"2025-03-28T03:06:56.000Z","dependencies_parsed_at":"2022-09-22T20:13:26.403Z","dependency_job_id":null,"html_url":"https://github.com/foolwood/pytorch-slimming","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolwood%2Fpytorch-slimming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolwood%2Fpytorch-slimming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolwood%2Fpytorch-slimming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolwood%2Fpytorch-slimming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foolwood","download_url":"https://codeload.github.com/foolwood/pytorch-slimming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","fast-inference","l1-regularization","pytorch","weight-pruning"],"created_at":"2024-08-03T21:00:52.397Z","updated_at":"2025-04-05T13:09:02.118Z","avatar_url":"https://github.com/foolwood.png","language":"Python","funding_links":[],"categories":["3.) Model Compression \u0026 Acceleration"],"sub_categories":["**[Papers]**"],"readme":"# pytorch-slimming\n\nThis is a **[PyTorch](http://pytorch.org/)** _re_-implementation of algorithm presented in \"[Learning Efficient Convolutional Networks Through Network Slimming](http://openaccess.thecvf.com/content_iccv_2017/html/Liu_Learning_Efficient_Convolutional_ICCV_2017_paper.html) (ICCV2017).\" . The official source code is based on Torch. For more info, visit the author's [webpage](https://github.com/liuzhuang13/slimming)!.\n\n|  CIFAR10-VGG16BN  | Baseline | Trained with Sparsity (1e-4) | Pruned (0.7 Pruned) | Fine-tuned (40epochs) |\n| :---------------: | :------: | :--------------------------: | :-----------------: | :-------------------: |\n| Top1 Accuracy (%) |  93.62   |            93.77             |        10.00        |         93.56         |\n|    Parameters     |  20.04M  |            20.04M            |        2.42M        |         2.42M         |\n\n|             Pruned Ratio             |       0       |     0.1      |      0.2      |     0.3      |     0.4      |     0.5      |     0.6      |     0.7      |\n| :----------------------------------: | :-----------: | :----------: | :-----------: | :----------: | :----------: | :----------: | :----------: | :----------: |\n| Top1 Accuracy (%) without Fine-tuned |     93.77     |    93.72     |     93.76     |    93.75     |    93.75     |    93.40     |    37.83     |    10.00     |\n|       Parameters(M) / macc(M)        | 20.04/ 398.44 | 15.9/ 349.22 | 12.28/ 307.78 | 9.12/ 272.94 | 6.74/ 247.86 | 4.62/ 231.86 | 3.14/ 222.17 | 2.42/ 210.84 |\n\n| Pruned Ratio |               architecture               |\n| :----------: | :--------------------------------------: |\n|      0       | [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 256, 'M', 512, 512, 512, 512, 'M', 512, 512, 512, 512] |\n|     0.1      | [60, 64, 'M', 128, 128, 'M', 256, 255, 253, 245, 'M', 436, 417, 425, 462, 'M', 463, 465, 472, 424] |\n|     0.2      | [58, 64, 'M', 128, 128, 'M', 256, 255, 250, 233, 'M', 360, 336, 329, 398, 'M', 420, 412, 435, 341] |\n|     0.3      | [56, 64, 'M', 128, 128, 'M', 256, 254, 249, 227, 'M', 284, 239, 244, 351, 'M', 369, 364, 384, 255] |\n|     0.4      | [52, 64, 'M', 128, 128, 'M', 256, 254, 247, 218, 'M', 218, 162, 166, 294, 'M', 317, 315, 318, 165] |\n|     0.5      | [52, 64, 'M', 128, 128, 'M', 256, 254, 245, 214, 'M', 179, 117, 116, 229, 'M', 228, 220, 210, 111] |\n|     0.6      | [51, 64, 'M', 128, 128, 'M', 256, 254, 245, 213, 'M', 165, 85, 92, 153, 'M', 83, 86, 87, 111] |\n|     0.7      | [49, 64, 'M', 128, 128, 'M', 256, 254, 234, 198, 'M', 114, 41, 24, 11, 'M', 14, 13, 19, 104] |\n\n## Baseline \n\n```shell\npython main.py\n```\n\n## Trained with Sparsity\n\n```shell\npython main.py -sr --s 0.0001\n```\n\n## Pruned\n\n```shell\npython prune.py --model model_best.pth.tar --save pruned.pth.tar --percent 0.7\n```\n\n## Fine-tuned\n\n```shell\npython main.py -refine pruned.pth.tar --epochs 40\n```\n\n## Reference\n\n```\n@InProceedings{Liu_2017_ICCV,\n    author = {Liu, Zhuang and Li, Jianguo and Shen, Zhiqiang and Huang, Gao and Yan, Shoumeng and Zhang, Changshui},\n    title = {Learning Efficient Convolutional Networks Through Network Slimming},\n    booktitle = {The IEEE International Conference on Computer Vision (ICCV)},\n    month = {Oct},\n    year = {2017}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoolwood%2Fpytorch-slimming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoolwood%2Fpytorch-slimming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoolwood%2Fpytorch-slimming/lists"}