-
- Downloads
Low-level pruning API refactor (#401)
Some refactoring of the low-level pruning API Added distiller/norms.py - for calculating norms of various sub-tensors. ranked_structures_pruner.py: -Removed l1_magnitude, l2_magnitude. Use instead distiller.norms.l1_norm -Lots of refactoring -replaced LpRankedStructureParameterPruner.ch_binary_map_to_mask with distiller.thresholding.expand_binary_map -FMReconstructionChannelPruner.rank_and_prune_channels used L2-norm by default and now uses L1-norm (i.e.magnitude_fn=l2_magnitude was replaced with magnitude_fn=distiller.norms.l1_norm) thresholding.py: -Delegated lots of the work to the new norms.py. -Removed support for 4D (entire convolution layers) since that has not been maintained for a longtime. This may break some old scripts that remove entire layers. -added expand_binary_map() explicitly so others can use it. Might need to move to a different file -removed threshold_policy() utils.py: -use distiller.norms.xxx for sparsity stats
Showing
- distiller/norms.py 326 additions, 0 deletionsdistiller/norms.py
- distiller/pruning/automated_gradual_pruner.py 1 addition, 3 deletionsdistiller/pruning/automated_gradual_pruner.py
- distiller/pruning/level_pruner.py 7 additions, 5 deletionsdistiller/pruning/level_pruner.py
- distiller/pruning/magnitude_pruner.py 11 additions, 1 deletiondistiller/pruning/magnitude_pruner.py
- distiller/pruning/pruner.py 17 additions, 7 deletionsdistiller/pruning/pruner.py
- distiller/pruning/ranked_structures_pruner.py 58 additions, 135 deletionsdistiller/pruning/ranked_structures_pruner.py
- distiller/pruning/sensitivity_pruner.py 10 additions, 6 deletionsdistiller/pruning/sensitivity_pruner.py
- distiller/pruning/splicing_pruner.py 34 additions, 27 deletionsdistiller/pruning/splicing_pruner.py
- distiller/pruning/structure_pruner.py 1 addition, 0 deletionsdistiller/pruning/structure_pruner.py
- distiller/thresholding.py 82 additions, 99 deletionsdistiller/thresholding.py
- distiller/utils.py 8 additions, 24 deletionsdistiller/utils.py
- examples/greedy_pruning/greedy_pruning.ipynb 11 additions, 2 deletionsexamples/greedy_pruning/greedy_pruning.ipynb
- examples/network_surgery/resnet20.network_surgery.yaml 2 additions, 2 deletionsexamples/network_surgery/resnet20.network_surgery.yaml
- tests/test_infra.py 5 additions, 1 deletiontests/test_infra.py
- tests/test_pruning.py 0 additions, 12 deletionstests/test_pruning.py
- tests/test_thresholding.py 217 additions, 10 deletionstests/test_thresholding.py
Loading
Please register or sign in to comment