Skip to content

xmodar/network_moments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Network Moments

Network Moments is a toolkit that enables computing some probabilistic moments of deep neural networks given a specific input distribution. The current implementation allows you to compute the first and second Gaussian network moments (GNM) of affine-ReLU-affine networks i.e., the output mean and variance subject to Gaussian input.

theorems

The main backend framework is PyTorch but also TensorFlow and MatLab are supported.

Requirements

Network Moments was developed and tested with the following:

You need Jupyter to run tightness. It is recommended that you have Jupyter Lab.

Installation

After installing the requirements, to install or update this package run the following in the terminal:

pip install -U git+https://github.com/ModarTensai/network_moments.git

Now go to the tightness notebook to see how to use this tool with the default backend framework.

To uninstall the package:

pip uninstall network_moments

Usage

To import the PyTorch sub-package:

import network_moments.torch as nm

The basic usage is demonstrated in the tightness notebook.

To import the TensorFlow sub-package:

import network_moments.tensorflow as nm

Please, refer to tensorflow tests notebook for examples to compare PyTorch and TensorFlow implementations.

Cite

This is the official implementation of the method described in this paper (checkout the poster):

@InProceedings{Bibi_2018_CVPR,
    author = {Bibi, Adel and Alfadly, Modar and Ghanem, Bernard},
    title = {Analytic Expressions for Probabilistic Moments of PL-DNN With Gaussian Input},
    booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
    month = {June},
    year = {2018}
}

License

MIT

Author

Modar M. Alfadly

Contributors

I would gladly accept any pull request that improves any aspect of this repository.

About

A toolkit for computing some probabilistic moments of deep neural networks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published