Skip to main content

No project description provided

Project description

vnnlib

PyPI - Version PyPI - Python Version


A python package for parsing neural network properties in the VNN-LIB format. It should currently parse a superset of the VNN-LIB spec that was supported by the example parser written by Stan Bak for VNN-COMP, and will produce compiled specs in the same format. Additionally, we allow parsing of gzip, bzip2, and lzma compressed specs.

Our parser is currently slower for some large files than the previous scripts due to the increased specification support. However, we expect significant optimization opportunities are available, and that overhead will decrease over time.

This package is still alpha software and APIs other than the compatibility API may change before the first release.

Installation

For the latest stable version, you can install from PyPI with:

pip install vnnlib

For the latest updates of vnnlib, you can pip install directly from the GitHub repo with:

pip install git+https://github.com/dlshriver/vnnlib.git@main

Usage

This package can be used as a drop-in replacement for the VNN-COMP utility script by importing

from vnnlib.compat import read_vnnlib_simple

wherever you previously imported read_vnnlib_simple.

Standalone

The parser can also be used to compile vnnlib ahead of time to reduce future property read times. The result of parsing will be pickled and saved to the location specified.

python -m vnnlib [FILE] --compat -o [OUTPUTFILE]

API

We provide a full VNN-LIB parser which will generate an AST for a given specification. To manipulate this AST to generate useful representations that can be dispatched to a verifier, we provide a transformer class which visits the nodes of the AST. We implement one version of this to parse and generate outputs in the format used in prior years of VNN-COMP in vnnlib/compat.py

Documentation will hopefully be coming soon.

License

vnnlib is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vnnlib-0.0.1.post1.tar.gz (15.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page