Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harry24k/bayesian-neural-network-pytorch
PyTorch implementation of bayesian neural network.
https://github.com/harry24k/bayesian-neural-network-pytorch
bayesian deep-learning neural-network pytorch
Last synced: 7 days ago
JSON representation
PyTorch implementation of bayesian neural network.
- Host: GitHub
- URL: https://github.com/harry24k/bayesian-neural-network-pytorch
- Owner: Harry24k
- License: mit
- Created: 2019-09-04T14:28:12.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-25T08:06:19.000Z (about 2 years ago)
- Last Synced: 2023-11-07T17:20:00.358Z (about 1 year ago)
- Topics: bayesian, deep-learning, neural-network, pytorch
- Language: Python
- Homepage:
- Size: 22.2 MB
- Stars: 392
- Watchers: 12
- Forks: 62
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bayesian-Neural-Network-Pytorch
This is a lightweight repository of bayesian neural network for PyTorch.
## Usage
### :clipboard: Dependencies
- torch 1.2.0
- python 3.6### :hammer: Installation
- `pip install torchbnn` or
- `git clone https://github.com/Harry24k/bayesian-neural-network-pytorch````python
import torchbnn
```### :rocket: Demos
* **Bayesian Neural Network Regression** ([code](https://github.com/Harry24k/bayesian-neural-network-pytorch/blob/master/demos/Bayesian%20Neural%20Network%20Regression.ipynb)):
In this demo, two-layer bayesian neural network is constructed and trained on simple custom data. It shows how bayesian-neural-network works and randomness of the model.
* **Bayesian Neural Network Classification** ([code](https://github.com/Harry24k/bayesian-neural-network-pytorch/blob/master/demos/Bayesian%20Neural%20Network%20Classification.ipynb)):
To classify Iris data, in this demo, two-layer bayesian neural network is constructed and trained on the Iris data. It shows how bayesian-neural-network works and randomness of the model.
* **Convert to Bayesian Neural Network** ([code](https://github.com/Harry24k/bayesian-neural-network-pytorch/blob/master/demos/Convert%20to%20Bayesian%20Neural%20Network.ipynb)):
To convert a basic neural network to a bayesian neural network, this demo shows how `nonbayes_to_bayes` and `bayes_to_nonbayes` work.
* **Freeze Bayesian Neural Network** ([code](https://github.com/Harry24k/bayesian-neural-network-pytorch/blob/master/demos/Freeze%20Bayesian%20Neural%20Network.ipynb)):
To freeze a bayesian neural network, which means force a bayesian neural network to output same result for same input, this demo shows the effect of `freeze` and `unfreeze`.## Citation
If you use this package, please cite the following BibTex (SemanticScholar, GoogleScholar):```
@article{lee2022graddiv,
title={Graddiv: Adversarial robustness of randomized neural networks via gradient diversity regularization},
author={Lee, Sungyoon and Kim, Hoki and Lee, Jaewook},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
year={2022},
publisher={IEEE}
}
```## :mag_right: Update Records
Here is [update records](Update%20Records.md) of this package.
## Thanks to
* @kumar-shridhar [github:PyTorch-BayesianCNN](https://github.com/kumar-shridhar/PyTorch-BayesianCNN)
* @xuanqing94 [github:BayesianDefense](https://github.com/xuanqing94/BayesianDefense)