Skip to main content

Bayesian Neural Network for PyTorch

Project description

Bayesian-Neural-Network-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.

Usage

Dependencies

  • torch 1.2.0
  • python 3.6

Installation

  • pip install torchbnn or
  • git clone https://github.com/Harry24k/bayesian-neural-network-pytorch
import torchbnn

Thanks to

Update Records

Version 0.1

  • modules : BayesLinear, BayesConv2d, BayesBatchNorm2d
  • utils : convert_model(nonbayes_to_bayes, bayes_to_nonbayes)
  • functional : bayesian_kl_loss

Version 0.2

  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torchbnn-0.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file torchbnn-0.2-py3-none-any.whl.

File metadata

  • Download URL: torchbnn-0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

File hashes

Hashes for torchbnn-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1c74e66954e21f66c89ad65ecda4b4045ab8d5d894188dc3680bf11e7a274042
MD5 ab8aed8dac0b22604510bdf69b391cb2
BLAKE2b-256 ac838c65c8155da01a0f789af66221217bb177ebe09f6cdf0f4510520f4caf23

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