Matthew McCann
University of Strathclyde, 2025
Developed with guidance and support from Marco de Angelis, University of Strathclyde
Zonolayer is a Python package for last-layer uncertainty modeling via zonotopic representations.
It provides zonotopic output bounds for neural networks with interval-bounded outputs, enabling precise and interpretable uncertainty quantification in regression tasks.
- Compute zonotopic bounds for last-layer outputs.
- Compatible with PyTorch networks.
- Modular, research-friendly, and easy to use.
By default, Zonolayer relies on NumPy for all numerical computations and interval handling.
If you require more advanced interval arithmetic (e.g., using pyinterval or other specialized packages), you can install the optional dependencies and modify the code accordingly, or submit a request for support to be added. I appreciate any and all feedback.
IPM support using the PyIPM library by J. Sadeghi
Ensure all requirements from requirements.txt are installed to reduce any potential issues.
pip install zonolayerSee the examples directory for working examples with different types of neural networks and data.
MIT License
Copyright (c) Matthew McCann
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

