A package for WISDOM, a white-box and semantically informed coverage testing tool for Deep Neural Networks with xAI methods.
Use conda or pyvenv to build a virtual environment.
# requriements
$ pip -r install requirements.txt
# If you are using anaconda or miniconda virtual environment, do:
$ conda env create -f requirements_venv.yaml$ git clone https://github.com/JoshuaQSH/Wisdom.git
$ cd Wisdom/dist
$ pip install wisdom-0.1.0-py3-none-any.whlWe will provide a package later on, but now you could use uv pip install just like pip install to get the lib.
$ uv venv wisdom --python 3.12
$ source .venv/bin/activate
$ uv pip install wisdom-0.1.0-py3-none-any.whlOr
$ uv pip install wisdomwith the pyproject.toml.
$ pip uninstall wisdomIn case of changes in the source code of the library, then the wheel package needs to be recreated. Please follow the steps below for receating the wheel package.
$ cd Wisdom/
$ python setup.py bdist_wheelOnce this is done, a Wisdom/dist directory will be created. Then follow the instractions in the installation section.
build: Lib build filewisdomattribution: Main attribution methods definition and a customized templateclustering: Clustering methods and WISDOM assignmentscore: Core files of WISDOMpruning: Pruning methods (mask and weight pruning)utils: Helper and common files
coverage_methods: Some basline coverage-based methodsdist: WheelsDocker: Docker file [WiP]saved_files: Saved files, including the neuron importance scores in CSVconfig.pyrequirements_venv.yamlrequirements.txtpyproject.tomlsetup.pyrun_wisdom.py
$ python3 run_wisdom.py \
--impl wisdom \
--model-name lenet \
--dataset cifar10 \
--data-path /path/to/datasets \
--device cuda:0 \
--top-m-neurons 10 \
--batch-size 64 \
--end2end \
--all-class \
--csv-file ./saved_files/pre_csv/lenet_cifar10.csv \
--model-path ./models_info/saved_models/lenet_CIFAR10_whole.pthSee Docker with the Dockerfile
