jacobgil/pytorch-pruning
소개
논문 [1611.06440] 「자원 효율적인 추론을 위한 합성곱 신경망 가지치기」의 PyTorch 구현
시스템 및 인프라측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalPyTorch implementation of [1611.06440 Pruning Convolutional Neural Networks for Resource Efficient Inference]
This demonstrates pruning a VGG16 based classifier that classifies a small dog/cat dataset.
This was able to reduce the CPU runtime by x3 and the model size by x4.
For more details you can read the blog post.
At each pruning step 512 filters are removed from the network.
Usage
This repository uses the PyTorch ImageFolder loader, so it assumes that the images are in a different directory for each category.
Train
......... dogs
......... cats
Test
......... dogs
......... cats
The images were taken from here but you should try training this on your own data and see if it works!
Training:
python finetune.py --train
Pruning:
python finetune.py --prune
TBD
Change the pruning to be done in one pass. Currently each of the 512 filters are pruned sequentually.
for layer_index, filter_index in prune_targets: model = prune_vgg16_conv_layer(model, layer_index, filter_index)This is inefficient since allocating new layers, especially fully connected layers with lots of parameters, is slow.
In principle this can be done in a single pass.
Change prune_vgg16_conv_layer to support additional architectures. The most immediate one would be VGG with batch norm.
관련 프로젝트 살펴보기
불러오는 중…