OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Bayesian Neural Networks

Bayesian Neural Networks is a public code repository of PyTorch implementations for approximate inference in Bayesian neural networks, paired with regression and MNIST classification scripts and notebooks.

Independent OpenViST project profile, based on linked sources.

Bayesian Neural Networks — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you need reference implementations and runnable experimental examples for comparing approximate inference methods in neural networks, particularly on regression and MNIST tasks.

Who it is for

  • Researchers comparing approximate inference methods on regression or MNIST tasks.
  • Practitioners prototyping Bayesian neural-network classifiers or uncertainty experiments.
  • PyTorch users studying predictive uncertainty, model weights and training workflows.

Documented uses

  • Train Bayesian neural-network models on MNIST using the included method-specific scripts.
  • Explore homoscedastic and heteroscedastic regression examples with toy or UCI datasets.
  • Compare inference methods and examine uncertainty under rotated-digit inputs.
  • Inspect, plot or prune model weights using the classification notebooks.
Before you choose

Requirements & limits

The public repository displays an MIT license badge. The README lists PyTorch, NumPy and Matplotlib as prerequisites and documents Python 2.7 with PyTorch 1.0.1.

  • The documented environment is an older Python and PyTorch stack; assess whether it fits your intended development environment.
  • CPU execution is documented, with CUDA used automatically when available; Colab notebooks provide a separate GPU workflow.
  • Method-specific scripts expose different training options, and training metrics and weights are saved to specified directories.
  • The README describes fixed-learning-rate SGLD practice while noting annealing conditions for convergence to the true posterior.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Train a Bayes by Backprop model on MNIST

Run the repository’s documented MNIST training script for Bayes by Backprop.

Before you start

  • Python 2.7
  • PyTorch 1.0.1
  • NumPy
  • Matplotlib

Steps

  1. Use the repository’s MNIST training script, train_BayesByBackprop_MNIST.py.

  2. Run the command below to view the script’s arguments.

    Documented command
    python train_BayesByBackprop_MNIST.py -h
  3. Run the command below with any desired documented options: --model, --prior_sig, --epochs, --lr, --n_samples, --models_dir, or --results_dir.

    Documented command
    python train_BayesByBackprop_MNIST.py
  4. Review the specified output directories for training metrics and model weights.

Expected outcome

The script trains a Bayes by Backprop model on MNIST and saves training metrics and model weights to specified directories.

Guide limitations

  • The README says best results are obtained with a Laplace prior.
  • If CUDA is available, it is used automatically; the models can also run on CPU.
Source-based practical guide

Train an MC Dropout model on MNIST

Run the repository’s documented MNIST training script for MC Dropout.

Before you start

  • Python 2.7
  • PyTorch 1.0.1
  • NumPy
  • Matplotlib

Steps

  1. Use the repository’s MNIST training script, train_MCDropout_MNIST.py.

  2. Run the command below to view the script’s arguments.

    Documented command
    python train_MCDropout_MNIST.py -h
  3. Run the command below with any desired documented options: --weight_decay, --epochs, --lr, --models_dir, or --results_dir.

    Documented command
    python train_MCDropout_MNIST.py
  4. Review the specified output directories for training metrics and model weights.

Expected outcome

The script trains an MC Dropout model on MNIST and saves training metrics and model weights to specified directories.

Guide limitations

  • The README specifies a fixed dropout rate of 0.5.
  • If CUDA is available, it is used automatically; the models can also run on CPU.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
JavierAntoran/Bayesian-Neural-Networks · Official homepage title · retained in its source language