Bayesian Neural Network for PyTorch
This is a lightweight repository of bayesian neural network for Pytorch. There are bayesian versions of pytorch layers and some utils. The aim is to help construct bayesian neural network intuitively.
- torch 1.2.0
- python 3.6
pip install torchbnnor
git clone https://github.com/Harry24k/bayesian-neural-network-pytorch
- modules : BayesLinear, BayesConv2d, BayesBatchNorm2d
- utils : convert_model(nonbayes_to_bayes, bayes_to_nonbayes)
- functional : bayesian_kl_loss
- prior_sigma is used when initialize modules and functions instead of prior_log_sigma
- Modules(BayesLinear, BayesConv2d, BayesBatchNorm2d) are re-defined with prior_sigma instead of prior_log_sigma.
- convert_model(nonbayes_to_bayes, bayes_to_nonbayes) is also changed with prior_sigma instead of prior_log_sigma.
- Modules(BayesLinear, BayesConv2d, BayesBatchNorm2d) : Base initialization method is changed to the method of Adv-BNN from the original torch method.
- functional : bayesian_kl_loss is changed similar to ones in torch.functional
- loss : BKLLoss is added based on bayesian_kl_loss similar to ones in torch.loss
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size torchbnn-0.2-py3-none-any.whl (9.1 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|