← 开源
Eric-mingjie

network-slimming

Network Slimming (Pytorch) (ICCV 2017)

InfrastructureModel optimizationPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
919
Star
213
Fork
+1
本周
2
贡献者
创建于 2018-07-05 · 更新于 2026-10-14 · 今日第 12639 名
主要开发者

Eric-mingjie/network-slimming 排名第 12,639,有 919 个星标。

同类别比较

Eric-mingjie/network-slimming 排名第 12,639,此处有 8 个同类条目;tensorflow/compression 排名第 12,617。

同类别比较
名称排名指标
PaddlePaddle/Serving12,597
语言:
C++
星标数:
925
分叉数:
246
简介:
A flexible, high-performance carrier for machine learning models(『飞桨』服务化部署框架)
SecretiveShell/MCP-Bridge12,603
语言:
Python
星标数:
924
分叉数:
119
简介:
A middleware to provide an openAI compatible endpoint that can call MCP tools
google-deepmind/xmanager12,614
语言:
Python
星标数:
922
分叉数:
70
简介:
A platform for managing machine learning experiments
tensorflow/compression12,617
语言:
Python
星标数:
922
分叉数:
257
简介:
Data compression in TensorFlow
facebookresearch/pysparnn12,662
语言:
Python
星标数:
916
分叉数:
142
简介:
Approximate Nearest Neighbor Search for Sparse Data in Python!
innovatorved/whisper.api12,687
语言:
Python
星标数:
912
分叉数:
38
简介:
This project provides an API with user level access support to transcribe speech to text using a finetuned and processed Whisper ASR model.
oramasearch/onnx-go12,722
语言:
Go
星标数:
908
分叉数:
83
简介:
onnx-go gives the ability to import a pre-trained neural network within Go without being linked to a framework or library.
zhihu/ZhiLight12,733
语言:
C++
星标数:
907
分叉数:
107
简介:
A highly optimized LLM inference acceleration engine for Llama and its variants.
关键参数与规格
关键参数与规格
参数值
语言Python
类别Infrastructure
子类别Model optimization
关键词Pruning
星标数919
分叉数213
贡献者2
创建日期2018-07-05
更新日期2026-10-14
1 天星标数0
7 天星标数1
排名12,639
上次排名12,555
排名变化-84
7 天星标排名10,445
上次 7 天星标排名10,495
7 天星标排名变化50
总星标排名11,874
上次总星标排名11,853
总星标排名变化-21
国家USA
README 摘录

Network Slimming (Pytorch) This repository contains an official pytorch implementation for the following paper Learning Efficient Convolutional Networks Through Network Slimming (ICCV 2017). Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, Changshui Zhang. Original implementation: slimming in Torch. 0 Channel Selection Layer We introduce layer to help the pruning of ResNet and DenseNet. It stores a parameter which is initialized to an all-1 vector. During pruning, it will set some places to 0 which correspond to the

pruned channels. Baseline The argument specifies which dataset to use: or . The argument specifies the architecture to use: , or . The depth is chosen to be the same as the networks used in the paper. Train with Sparsity Prune The pruned model will be named . Fine-tune Results The results are fairly close to the original paper, whose results are produced by Torch. Note that due to different random seeds, there might be up to ~0. 5% fluctation on CIFAR-10

/100 datasets in different runs, according to our experiences. However, we also provide a mask implementation where we apply a mask to the scaling factor in BN layer. For mask implementaion, when pruning 60% of the channels in resnet164-cifar100, we can also train the pruned network.

常见问题

记录了多少星标和分叉?

Eric-mingjie/network-slimming 有 919 个星标和 213 个分叉。

仓库排名是多少?

Eric-mingjie/network-slimming 排名第 12,639。

记录的语言和类别是什么?

Eric-mingjie/network-slimming 有 919 个星标,语言为 Python,类别为 Infrastructure。

哪个仓库排名最接近?

Eric-mingjie/network-slimming 与 tensorflow/compression 比较,后者排名第 12,617,有 922 个星标。

README

Network Slimming (Pytorch)

This repository contains an official pytorch implementation for the following paper
Learning Efficient Convolutional Networks Through Network Slimming (ICCV 2017).
Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, Changshui Zhang.

Original implementation: slimming in Torch.
The code is based on pytorch-slimming. We add support for ResNet and DenseNet.

Citation:

@InProceedings{Liu_2017_ICCV,
    author = {Liu, Zhuang and Li, Jianguo and Shen, Zhiqiang and Huang, Gao and Yan, Shoumeng and Zhang, Changshui},
    title = {Learning Efficient Convolutional Networks Through Network Slimming},
    booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
    month = {Oct},
    year = {2017}
}

Dependencies

torch v0.3.1, torchvision v0.2.0

Channel Selection Layer

We introduce channel selection layer to help the pruning of ResNet and DenseNet. This layer is easy to implement. It stores a parameter indexes which is initialized to an all-1 vector. During pruning, it will set some places to 0 which correspond to the pruned channels.

Baseline

The dataset argument specifies which dataset to use: cifar10 or cifar100. The arch argument specifies the architecture to use: vgg,resnet or densenet. The depth is chosen to be the same as the networks used in the paper.

python main.py --dataset cifar10 --arch vgg --depth 19
python main.py --dataset cifar10 --arch resnet --depth 164
python main.py --dataset cifar10 --arch densenet --depth 40

Train with Sparsity

python main.py -sr --s 0.0001 --dataset cifar10 --arch vgg --depth 19
python main.py -sr --s 0.00001 --dataset cifar10 --arch resnet --depth 164
python main.py -sr --s 0.00001 --dataset cifar10 --arch densenet --depth 40

Prune

python vggprune.py --dataset cifar10 --depth 19 --percent 0.7 --model [PATH TO THE MODEL] --save [DIRECTORY TO STORE RESULT]
python resprune.py --dataset cifar10 --depth 164 --percent 0.4 --model [PATH TO THE MODEL] --save [DIRECTORY TO STORE RESULT]
python denseprune.py --dataset cifar10 --depth 40 --percent 0.4 --model [PATH TO THE MODEL] --save [DIRECTORY TO STORE RESULT]

The pruned model will be named pruned.pth.tar.

Fine-tune

python main.py --refine [PATH TO THE PRUNED MODEL] --dataset cifar10 --arch vgg --depth 19 --epochs 160

Results

The results are fairly close to the original paper, whose results are produced by Torch. Note that due to different random seeds, there might be up to ~0.5%/1.5% fluctation on CIFAR-10/100 datasets in different runs, according to our experiences.

CIFAR10

CIFAR10-Vgg Baseline Sparsity (1e-4) Prune (70%) Fine-tune-160(70%)
Top1 Accuracy (%) 93.77 93.30 32.54 93.78
Parameters 20.04M 20.04M 2.25M 2.25M
CIFAR10-Resnet-164 Baseline Sparsity (1e-5) Prune(40%) Fine-tune-160(40%) Prune(60%) Fine-tune-160(60%)
Top1 Accuracy (%) 94.75 94.76 94.58 95.05 47.73 93.81
Parameters 1.71M 1.73M 1.45M 1.45M 1.12M 1.12M
CIFAR10-Densenet-40 Baseline Sparsity (1e-5) Prune (40%) Fine-tune-160(40%) Prune(60%) Fine-tune-160(60%)
Top1 Accuracy (%) 94.11 94.17 94.16 94.32 89.46 94.22
Parameters 1.07M 1.07M 0.69M 0.69M 0.49M 0.49M

CIFAR100

CIFAR100-Vgg Baseline Sparsity (1e-4) Prune (50%) Fine-tune-160(50%)
Top1 Accuracy (%) 72.12 72.05 5.31 73.32
Parameters 20.04M 20.04M 4.93M 4.93M
CIFAR100-Resnet-164 Baseline Sparsity (1e-5) Prune (40%) Fine-tune-160(40%) Prune(60%) Fine-tune-160(60%)
Top1 Accuracy (%) 76.79 76.87 48.0 77.36 --- ---
Parameters 1.73M 1.73M 1.49M 1.49M --- ---

Note: For results of pruning 60% of the channels for resnet164-cifar100, in this implementation, sometimes some layers are all pruned and there would be error. However, we also provide a mask implementation where we apply a mask to the scaling factor in BN layer. For mask implementaion, when pruning 60% of the channels in resnet164-cifar100, we can also train the pruned network.

CIFAR100-Densenet-40 Baseline Sparsity (1e-5) Prune (40%) Fine-tune-160(40%) Prune(60%) Fine-tune-160(60%)
Top1 Accuracy (%) 73.27 73.29 67.67 73.76 19.18 73.19
Parameters 1.10M 1.10M 0.71M 0.71M 0.50M 0.50M

Contact

sunmj15 at gmail.com liuzhuangthu at gmail.com

排名相邻
同类项目