File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change 22
33This demonstrates pruning a VGG16 based classifier that classifies a small dog/cat dataset.
44
5+
56This was able to reduce the CPU runtime by x3 and the model size by x4.
7+
68For more details you can read the [ blog post] ( https://jacobgil.github.io/deeplearning/pruning-deep-learning ) .
79
810At each pruning step 512 filters are removed from the network.
@@ -12,14 +14,21 @@ Usage
1214-----
1315
1416This repository uses the PyTorch ImageFolder loader, so it assumes that the images are in a different directory for each category.
15- `Train
17+
18+ Train
19+
1620......... dogs
21+
1722......... cats
18- `
19- `Test
23+
24+
25+ Test
26+
27+
2028......... dogs
29+
2130......... cats
22- `
31+
2332
2433The images were taken from [ here] ( https://www.kaggle.com/c/dogs-vs-cats ) but you should try training this on your own data and see if it works!
2534
3645In principle this can be done in a single pass.
3746
3847{% highlight python %}
39- for layer_index, filter_index in prune_targets:
40- model = prune_vgg16_conv_layer(model, layer_index, filter_index)
48+
49+ for layer_index, filter_index in prune_targets:
50+ model = prune_vgg16_conv_layer(model, layer_index, filter_index)
51+
4152{% endhighlight %}
4253
4354 - Change prune_vgg16_conv_layer to support additional architectures.
You can’t perform that action at this time.
0 commit comments