503a3579511fcb40642a09958dd5377875647309,src/sdk/pynni/nni/compression/torch/builtin_pruners.py,SlimPruner,__init__,#SlimPruner#Any#Any#,356
Before Change
weight_list.append(layer.module.weight.data.clone())
all_bn_weights = torch.cat(weight_list)
k = int(all_bn_weights.shape[0] * config["sparsity"])
self.global_threshold = torch.topk(all_bn_weights.view(-1), k, largest=False).values.max()
def calc_mask(self, layer, config):
After Change
weight_list.append(layer.module.weight.data.abs().clone())
all_bn_weights = torch.cat(weight_list)
k = int(all_bn_weights.shape[0] * config["sparsity"])
self.global_threshold = torch.topk(all_bn_weights.view(-1), k, largest=False)[0].max()
def calc_mask(self, layer, config):
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: Microsoft/nni
Commit Name: 503a3579511fcb40642a09958dd5377875647309
Time: 2019-11-24
Author: lanny@mail.hfut.edu.cn
File Name: src/sdk/pynni/nni/compression/torch/builtin_pruners.py
Class Name: SlimPruner
Method Name: __init__
Project Name: Microsoft/nni
Commit Name: 503a3579511fcb40642a09958dd5377875647309
Time: 2019-11-24
Author: lanny@mail.hfut.edu.cn
File Name: src/sdk/pynni/nni/compression/torch/builtin_pruners.py
Class Name: LevelPruner
Method Name: calc_mask
Project Name: Microsoft/nni
Commit Name: 503a3579511fcb40642a09958dd5377875647309
Time: 2019-11-24
Author: lanny@mail.hfut.edu.cn
File Name: src/sdk/pynni/nni/compression/torch/builtin_pruners.py
Class Name: L1FilterPruner
Method Name: calc_mask
Project Name: Microsoft/nni
Commit Name: 503a3579511fcb40642a09958dd5377875647309
Time: 2019-11-24
Author: lanny@mail.hfut.edu.cn
File Name: src/sdk/pynni/nni/compression/torch/builtin_pruners.py
Class Name: AGP_Pruner
Method Name: calc_mask