Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Filter Pruning via Geometric Median for Deep Convolutional Neural Networks Acceleration (CVPR 2019 Oral)
| Date | Stars |
|---|---|
| 2026-07-31 | 617 |
| 2026-08-05 | 617 |
| 2026-08-06 | 617 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Filter Pruning via Geometric Median for Deep Convolutional Neural Networks Acceleration

**[CVPR 2019 Oral](http://openaccess.thecvf.com/content_CVPR_2019/html/He_Filter_Pruning_via_Geometric_Median_for_Deep_Convolutional_Neural_Networks_CVPR_2019_paper.html)**.
Implementation with PyTorch. This implementation is based on [soft-filter-pruning](https://github.com/he-y/soft-filter-pruning).
## What's New
FPGM has been re-implemented in [Pytorch](https://github.com/pytorch/pytorch) and [NNI](https://github.com/microsoft/nni).
### Usage in [Pytorch](https://github.com/pytorch/pytorch)
```
from torch.ao.sparsity.pruning._experimental.pruner import FPGM_pruner
# set network-level sparsity: all layers have a sparsity level of 30%
pruner = FPGMPruner(sparsity_level = 0.3)
# set layer-level sparsity: sparsity_level of conv2d1 = 30%, sparsity_level of conv2d2 = 50%
config = [
{"tensor_fqn": "conv2d1.weight"},
{"tensor_fqn": "conv2d2.weight", "sparsity_level": 0.5}
]
pruner.prepare(model, config)
pruner.enable_mask_update = True
pruner.step()
# Get real pruned models (without zeros)
pruned_model = pruner.prune()
```
See source code [here](https://github.com/pytorch/pytorch/blob/main/torch/ao/pruning/_experimental/pruner/FPGM_pruner.py) and official test code [here](https://github.com/pytorch/pytorch/blob/main/test/ao/sparsity/test_structured_sparsifier.py#L921-L1041).
### Usage in [NNI](https://github.com/microsoft/nni)
```
from nni.algorithms.compression.pytorch.pruning import FPGMPruner
config_list = [{
'sparsity': 0.5,
'op_types': ['Conv2d']
}]
pruner = FPGMPruner(model, config_list)
pruner.compress()
```
See explanation [here](https://nni.readthedocs.io/en/v2.1/Compression/Pruner.html#fpgm-pruner).
## Table of Contents
- [Requirements](#requirements)
- [Models and log files](#models-and-log-files)
- [Training ResNet on ImageNet](#training-resnet-on-imagenet)
- [Usage of Pruning Training](#usage-of-pruning-training)
- [Usage of Normal Training](#usage-of-normal-training)
- [Inference the pruned model with zeros](#inference-the-pruned-model-with-zeros)
- [Inference the pruned model without zeros](#inference-the-pruned-model-without-zeros)
- [Scripts to reproduce the results in our paper](#scripts-to-reproduce-the-results-in-our-paper)
- [Training ResNet on Cifar-10](#training-resnet-on-cifar-10)
- [Training VGGNet on Cifar-10](#training-vggnet-on-cifar-10)
- [Notes](#notes)
- [Torchvision Version](#torchvision-version)
- [Why use 100 epochs for training](#why-use-100-epochs-for-training)
- [Process of ImageNet dataset](#process-of-imagenet-dataset)
- [FLOPs Calculation](#flops-calculation)
- [Citation](#citation)
## Requirements
- Python 3.6
- PyTorch 0.3.1
- TorchVision 0.3.0
## Models and log files
The trained models with log files can be found in [Google Drive](https://drive.google.com/drive/folders/1w_Max8L5ICJZSrlha8UybHfICik-iX95?usp=sharing).
Specifically:
[models for pruning ResNet on ImageNet](https://drive.google.com/drive/u/1/folders/1DOYiOZGQxr94rWsEw73ezz9a-0hcNf-2)
[models for pruning ResNet on CIFAR-10](https://drive.google.com/drive/u/1/folders/1YLhcY487U0ZdGiDHzJBJZOJLFYBhrBoD)
[models for pruning VGGNet on CIFAR-10](https://drive.google.com/drive/u/1/folders/1hGnULraEbz8IjSRZx_juzZnvDTDqDdt-)
[models for ablation study](https://drive.google.com/drive/u/1/folders/1PZLOw51n8yvdKO0pzAk_9t6It9Awq6GU)
The pruned model without zeros, refer to [this issue](https://github.com/he-y/filter-pruning-geometric-median/issues/7).
## Training ResNet on ImageNet
#### Usage of Pruning Training
We train each model from scratch by default. If you wish to train the model with pre-trained models, please use the options `--use_pretrain --lr 0.01`.
Run Pruning Training ResNet (depth 152,101,50,34,18) on Imagenet:
```bash
python pruning_imagenet.py -a resnet152 --save_path ./snapshoExcerpt of 8,609 characters
Read on GitHub17
Megvii Research · China
2
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:2d75035d16ce0a10, topic:model-compression, topic:pruning, name:pruning