Package: pyNeVer
pyNeVerNeural networks Verifier (NeVer 2) is a tool for the training, pruning and verification of neural networks.
At present it supports sequential fully connected neural networks with ReLU and Sigmoid activation functions.pyNeVeris the corresponding python package providing all the main capabilities of theNeVer 2tool
and can be easily installed using pip. The PyPI project page can be found athttps://pypi.org/project/pyNeVer/whereas the github repository can be found athttps://github.com/NeVerTools/pyNeVer.REQUIREMENTS AND INSTALLATIONpyNeVerdepends on several packages, which should be installed automatically. The packages required for the
correct execution are the following:numpyortoolsonnxtorchtorchvisionpysmtAll the above packages are available via pip.To installpyNeVer, run the command:pipinstallpyneverTo run some examples, further packages may be required. If an example requires a specific package, it will be
detailed in the example directory.DOCUMENTATIONThe documentation related to thepyNeVerpackage can be found in the directory docs/pynever/ as html files.SUPPORTED INPUTSAt present thepyNeVerpackage supports only the abstraction and verification of fully connected neural networks
with ReLU and Sigmoid activation functions. The training, pruning and conversion supports also batch normalization
layers. A network with batchnorm layers following fully connected layers can be converted to a "pure" fully connected
neural networks using the capabilities provided in theutilities.pymodule.Theconversion.pyprovides the capabilities for the conversion of PyTorch and ONNX
networks: therefore this kind of networks can be loaded using the respective frameworks and then converted to the
internal representation used bypyNeVer.
The properties for the verification and abstraction of the networks must be defined either in python code following
the specification which can be found in the documentation, or via an SMT-LIB file compliant to theVNN-LIBstandard.EXAMPLESNB: All the scripts should be executed INSIDE the related directory!All the examples described below are guaranteed to work untilRelease v0.1.1a4.
After this release, changes in the interface structure may add inconsistencies between test scripts and API, so
the old examples will be removed and new examples will be created in future releases.The directory examples/ contains some examples of application of thepyNeVerpackage. In particular thejupyter notebookshows a graphical example of the
application of the abstraction module for the reachability of a small network with bi-dimensional input and outputs.Thepruning_example.pyscript show how to train and prune some small
fully connected neural networks with relu activation function. It also show how it is possible to combine batch norm
layer and fully connected layers to make the networks compliant with the requirements of the verification and
abstraction modules.The directory examples/submissions/ATVA2021 contains the experimental setup used for the experimental evaluation
in our ATVA2021 paper. The experiments can be easily replicated by executing the python scriptsacas_experiment.pyfrom within the ATVA2021/ directory.
The log files will be generated and will be saved in the logs/ directory.CONTRIBUTORSThe main contributors of pyNeVer areDario GuidottiandArmando Tacchella, further contributions are provided
byStefano Demarchi.Students contributions:Alessandro Drago- TensorFlow conversionAndrea Gimelli- Bound propagation integrationPedro Henrique Simão Achete- Command-line interface