Giter Site home page Giter Site logo

npc's Introduction

Overview of NPC :

image

Parameters:

In our paper, the value ranges of the three hyperparameters α, β and k are {0.7,0.8,0.9,1.0}, {0.6,0.7,0.8,0.9} and {1,4,7}, respectively.

Derive LRP path.

first, please download some pretrained weight, data and seed case from drive.google.com by our scripts.

More data will be released in future.

  • download MNIST's model's weight (4.7 Mb), MNIST dataset (53 Mb), one seed-case (36Mb)

cd data && python download.py --download_mnist_example && cd ..

RQ1 Mask Experiment.

We can run mask_critical_units.py to get inconsistency rate after masking neurons in CDP and NCDP.

python mask_critical_units.py --paths_path ./data/LRP_path/mnist_convmnist_lrp_path_threshold0.8_train.pkl --data_train --dataset mnist --arc convmnist

python mask_critical_units.py --paths_path ./data/LRP_path/cifar10_convcifar10_lrp_path_threshold0.7_train.pkl --data_train --dataset cifar10 --arc convcifar10

python mask_critical_units.py --paths_path ./data/LRP_path/cifar10_vgg_lrp_path_threshold0.9_train.pkl --data_train --dataset cifar10 --arc vgg

python mask_critical_units.py --paths_path ./data/LRP_path/SVHN_alexnet_lrp_path_threshold0.7_train.pkl --data_train --dataset SVHN --arc alexnet

python mask_critical_units.py --paths_path ./data/LRP_path/imagenet_vgg16_bn_lrp_path_threshold0.7_train.pkl --data_train --dataset imagenet --arc vgg16_bn

RQ2 Cluster.

We can run cluster_three_level_mask.py to cluster theses paths and derive the abstract path.

python cluster_three_level_mask.py --paths_path ./data/LRP_path/mnist_convmnist_lrp_path_threshold0.8_train.pkl --arc convmnist --b_cluster --dataset mnist --gpu 1 --n_clusters 4 --threshold 0.8 --grids 5 --data_train

python cluster_three_level_mask.py --paths_path LRP_path/cifar10_convcifar10_lrp_path_threshold0.7_train.pkl --arc convcifar10 --b_cluster --dataset cifar10 --gpu 1 --n_clusters 7 --threshold 0.9 --grids 5 --data_train

python cluster_three_level_mask.py --paths_path LRP_path/cifar10_vgg_lrp_path_threshold0.9_train.pkl --arc vgg --b_cluster --dataset cifar10 --gpu 1 --n_clusters 7 --threshold 0.9 --grids 5 --data_train

python cluster_three_level_mask.py --paths_path LRP_path/SVHN_alexnet_lrp_path_threshold0.7_train.pkl --arc alexnet --b_cluster --dataset SVHN --gpu 1 --n_clusters 4 --threshold 0.6 --grids 5 --data_train

python cluster_three_level_mask.py --paths_path LRP_path/imagenet_vgg16_bn_lrp_path_threshold0.7_train.pkl --arc vgg16_bn --b_cluster --dataset imagenet --gpu 1 --n_clusters 4 --threshold 0.7 --grids 5 --data_train

RQ3 SNPC,LSA,DSA,ANPC

In calc_NPC.py, we inplemented the SNPC. And in calc_sadl, we can run new_run_torch.py to get the LSA,DSA,ANPC metric.

  • ANPC
    batch_size=64 python new_run_torch.py -nma
  • SNPC
    batch_size=64 python calc_SNPC.py
  • LSA(LSC) DSA(DSC)
    batch_size=64 python new_run_torch.py -lsa -dsa --last_layer

Citation

@article{xie2022npc,
  title={NPC: N euron P ath C overage via Characterizing Decision Logic of Deep Neural Networks},
  author={Xie, Xiaofei and Li, Tianlin and Wang, Jian and Ma, Lei and Guo, Qing and Juefei-Xu, Felix and Liu, Yang},
  journal={ACM Transactions on Software Engineering and Methodology},
  year={2022},
  publisher={ACM New York, NY}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.