89fa23cb77746d36b4f1ff6cd4fcefbab18c7d70,src/sdk/pynni/tests/test_compressor.py,CompressorTestCase,test_torch_l1filter_pruner,#CompressorTestCase#,164

Before Change


        If sparsity is 0.6, the expected masks should mask out filter 0,1,2, this can be verified through:
        `all(torch.sum(mask2, (1, 2, 3)).numpy() == np.array([0., 0., 0., 27., 27.]))`
        
        w = np.array([np.zeros((3, 3, 3)), np.ones((3, 3, 3)), np.ones((3, 3, 3)) * 2,
                      np.ones((3, 3, 3)) * 3, np.ones((3, 3, 3)) * 4])
        model = TorchModel()
        config_list = [{"sparsity": 0.2, "op_types": ["Conv2d"], "op_names": ["conv1"]},
                       {"sparsity": 0.6, "op_types": ["Conv2d"], "op_names": ["conv2"]}]
        pruner = torch_compressor.L1FilterPruner(model, config_list)

After Change


        `all(torch.sum(mask2, (1, 2, 3)).numpy() == np.array([0., 0., 0., 0., 0., 0., 125., 125., 125., 125.]))`
        
        w1 = np.array([np.ones((1, 5, 5))*i for i in range(5)]).astype(np.float32)
        w2 = np.array([np.ones((5, 5, 5))*i for i in range(10)]).astype(np.float32)

        model = TorchModel()
        config_list = [{"sparsity": 0.2, "op_types": ["Conv2d"], "op_names": ["conv1"]},
                       {"sparsity": 0.6, "op_types": ["Conv2d"], "op_names": ["conv2"]}]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: microsoft/nni
Commit Name: 89fa23cb77746d36b4f1ff6cd4fcefbab18c7d70
Time: 2020-06-11
Author: 38930155+chicm-ms@users.noreply.github.com
File Name: src/sdk/pynni/tests/test_compressor.py
Class Name: CompressorTestCase
Method Name: test_torch_l1filter_pruner


Project Name: tryolabs/luminoth
Commit Name: 6666e39bf763ab8e44c7036f27179449f1af69d9
Time: 2017-06-16
Author: javirey@gmail.com
File Name: frcnn/anchor_target.py
Class Name: AnchorTarget
Method Name: _anchor_target_layer_np


Project Name: chainer/chainercv
Commit Name: f7a41e4ddaa12a5cb19d0458431e88a16edd10b6
Time: 2018-03-26
Author: yuyuniitani@gmail.com
File Name: chainercv/visualizations/vis_instance_segmentation.py
Class Name:
Method Name: vis_instance_segmentation