Skip to content

MattCodes03/zonolayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zonolayer

Matthew McCann
University of Strathclyde, 2025

Developed with guidance and support from Marco de Angelis, University of Strathclyde

Python Version License: MIT PyPI Version

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.


Features

  • 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


Installation

Ensure all requirements from requirements.txt are installed to reduce any potential issues.

pip install zonolayer

Getting Started

See the examples directory for working examples with different types of neural networks and data.

Example Plots

Zonotopic bounds Zonotopic bounds 2


License

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.

About

Zonolayer is a Python library for modeling last-layer uncertainty in neural networks using zonotopic representations. It provides tools to bound, and visualise imprecision in a neural networks final layer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages