Skip to main content

Efficient Compositional Lipschitz Constant Estimation for Deep Neural Networks. Python implementation of the NeurIPS 2024 paper.

Project description

ECLipsE: Compositional-Estimation-of-Lipschitz-Constants

This repository is the codes for paper "ECLipsE: Efficient Compositional Lipschitz Constant Estimation for Deep Neural Networks" (NeurIPS 2024 paper), providing efficient and tight Lipschitz Estimate for feedforword neural networks (FNNs). ECLipsE.m and ECLipsE_Fast.m are functions for the two algorithms proposed and we can obtain the estimates for the Lipschitz constants (strict and tight upper bound), time used, and the trivial Lipschitz upper bound by directly calling the functions with weights of FNNs. The weights should be in the format of W1,W2,..., etc. and the biases are not needed for our methods. The activation functions for the FNNs need to be slope-restricted in [0,1], which is satisfied by most activation functions.

Install from PyPI

pip install eclipse-nn

Publish a new PyPI version

  1. Update the version in pyproject.toml.
  2. Build distributions:
python -m build
  1. Upload to PyPI:
python -m twine upload dist/*
  1. Create a matching GitHub release/tag.

To reproduce the experiments in paper, we first generate / train FNNs as

  1. For randomly generated neural networks, run generate_random_weights.py with corresponding depths and widths for FNNs. The weights of FNNs will be stored under datasets/random.
  2. For neural networks trained on mnist dataset, run training_MNIST.py. The weights of FNNs will be stored under datasets/MNIST.

All the results can be obtained through Lip_estimates.m.

ECLipsE-Gen-Local: Efficient Compositional Local Lipschitz Estimates for Deep Neural Networks

The code under folder ECLipsE_Gen_Local_matlab contains the code for algorithms series ECLipsE-Gen-Local. The algorithms give efficient, scalable and tight local Lipschitz estimates for deep FNN. Paper is accepted to TMLR in 2026.03, and is available at https://arxiv.org/abs/2510.05261.

Installation

We also provide implementation in python under the "python" folder for all the algorithms. Users can directly install the package PyPI version through pip install eclipse-nn.

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

eclipse_nn-0.1.6.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eclipse_nn-0.1.6-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file eclipse_nn-0.1.6.tar.gz.

File metadata

  • Download URL: eclipse_nn-0.1.6.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for eclipse_nn-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ffa154dccfa276cfb39020cfb96ca77027f63e898a53c749f1d080a28d4188f4
MD5 5a9cd6d305b420d4e8c543ced7458e14
BLAKE2b-256 e043a3663a7882ea1eb60ae5e5355af8c718f3beb6650a43bf9c167c741b8a3c

See more details on using hashes here.

File details

Details for the file eclipse_nn-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: eclipse_nn-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for eclipse_nn-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 248c227935a68e937cbb7dcdd5b121905835c6bfddd98a2e5a2f0cccb9c19ddf
MD5 5271176253c35709c84fb05355991540
BLAKE2b-256 c3e5af08342256c66a88e2c80b6a96e8e148c5ab01a3de20cf47cf1b260d5641

See more details on using hashes here.

Supported by

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