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.

We also provide implementation in python under the "python" folder.

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 alogrithm gives efficient, scalable and tight local Lipschitz estimates for deep FNN. Paper is available at https://arxiv.org/abs/2510.05261.

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.5.tar.gz (14.7 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.5-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eclipse_nn-0.1.5.tar.gz
  • Upload date:
  • Size: 14.7 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.5.tar.gz
Algorithm Hash digest
SHA256 645008687d2c9df88dd3a911c2d6f8ab5e39fe4703cdc09a5701b62234f70909
MD5 5cfc4af3fcb28dd0d104c12b4599cfce
BLAKE2b-256 f2f1a8fb8ede870b7de32b3f4cbddfa853defe558acd15b2981d3318a18f257d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eclipse_nn-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 16.4 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6a0910f5e3af628f7c3b532173e1ce7454661dec4a3912978d565383987a7ec6
MD5 d4528c33baf1fa39a6830835b2bd3060
BLAKE2b-256 641834a9fbe205056be1a298fed5952fbfbe6d715ff581ee09e3bad4cdcfd7d2

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