{"id":18423302,"url":"https://github.com/xmodar/network_moments","last_synced_at":"2025-04-07T15:32:40.623Z","repository":{"id":111509489,"uuid":"137558525","full_name":"xmodar/network_moments","owner":"xmodar","description":"A toolkit for computing some probabilistic moments of deep neural networks.","archived":false,"fork":false,"pushed_at":"2020-04-20T06:06:36.000Z","size":499,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T20:26:16.290Z","etag":null,"topics":["deep-learning","neural-networks","probability"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xmodar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-16T06:21:16.000Z","updated_at":"2024-11-26T16:57:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"dbf93de2-84db-4893-9353-75a4a45716b1","html_url":"https://github.com/xmodar/network_moments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmodar%2Fnetwork_moments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmodar%2Fnetwork_moments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmodar%2Fnetwork_moments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmodar%2Fnetwork_moments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmodar","download_url":"https://codeload.github.com/xmodar/network_moments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247679868,"owners_count":20978146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","neural-networks","probability"],"created_at":"2024-11-06T04:36:43.571Z","updated_at":"2025-04-07T15:32:40.617Z","avatar_url":"https://github.com/xmodar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Network Moments\n\nNetwork 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.\n\n\u003cimg src=\"./static/theorems.svg\" alt=\"theorems\"/\u003e\n\nThe main backend framework is [\u003cimg src=\"./static/pytorch-logo.png\" alt=\"PyTorch\" height=\"20px\"/\u003e](./network_moments/torch/) but also [\u003cimg src=\"./static/tensorflow-logo.png\" alt=\"TensorFlow\" height=\"20px\"/\u003e](./network_moments/tensorflow/) and [\u003cimg src=\"./static/matlab-logo.png\" alt=\"MatLab\" height=\"20px\"/\u003e](./matlab/) are supported.\n\n### Requirements\n\nNetwork Moments was developed and tested with the following:\n\n - [Python](https://www.python.org/) v3.6.3+\n - **Option 1**: [`PyTorch`](./network_moments/torch/)\n   - [torch](https://pytorch.org/) v0.4.1+\n   - [torchvision](https://github.com/pytorch/vision) v0.2.1+\n - **Option 2**: [`TensorFlow`](./network_moments/tensorflow/)\n   - [numpy](http://www.numpy.org) v1.14.2+\n   - [tensorflow](https://www.tensorflow.org/) v1.8.0+\n - **Option 3**: [`MatLab`](./matlab/)\n   - [matlab](https://www.mathworks.com/products/matlab.html) vR2017b+\n\nYou need [Jupyter](https://jupyter.org/) to run [tightness](./static/tightness.ipynb). It is recommended that you have [Jupyter Lab](https://github.com/jupyterlab/jupyterlab).\n\n### Installation\n\nAfter installing the requirements, to install or update this package run the following in the terminal:\n\n```sh\npip install -U git+https://github.com/ModarTensai/network_moments.git\n```\n\nNow go to the [tightness notebook](./static/tightness.ipynb) to see how to use this tool with the default backend framework.\n\nTo uninstall the package:\n\n```sh\npip uninstall network_moments\n```\n\n### Usage\n\nTo import the [`PyTorch`](./network_moments/torch/) sub-package:\n\n```python\nimport network_moments.torch as nm\n```\n\nThe basic usage is demonstrated in the [tightness notebook](./static/tightness.ipynb).\n\nTo import the [`TensorFlow`](./network_moments/tensorflow/) sub-package:\n\n```python\nimport network_moments.tensorflow as nm\n```\nPlease, refer to [tensorflow tests notebook](./static/tensorflow_tests.ipynb) for examples to compare [`PyTorch`](./network_moments/torch/) and [`TensorFlow`](./network_moments/tensorflow/) implementations.\n\n### Cite\n\nThis is the official implementation of the method described in [this paper](http://openaccess.thecvf.com/content_cvpr_2018/html/Bibi_Analytic_Expressions_for_CVPR_2018_paper.html) (checkout the [poster](https://drive.google.com/file/d/1S_HurI9vwhhqyzAabDiaq0ZJBPBrV_xh/view)):\n\n```bibtex\n@InProceedings{Bibi_2018_CVPR,\n    author = {Bibi, Adel and Alfadly, Modar and Ghanem, Bernard},\n    title = {Analytic Expressions for Probabilistic Moments of PL-DNN With Gaussian Input},\n    booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\n    month = {June},\n    year = {2018}\n}\n```\n\n### License\n\nMIT\n\n### Author\n\n[Modar M. Alfadly](https://github.com/ModarTensai/network_moments/)\n\n### Contributors\n\nI would gladly accept any pull request that improves any aspect of this repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmodar%2Fnetwork_moments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmodar%2Fnetwork_moments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmodar%2Fnetwork_moments/lists"}