bayesian_flow

A repo reproducing discrete/discretised Bayesian Flow Networks https://arxiv.org/abs/2308.07037 for MNIST and CIFAR10 datasets

https://github.com/rupertmenneer/bayesian_flow

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.7%) to scientific vocabulary

Keywords

bayesian-flow bayesian-flow-networks cifar10 mnist
Last synced: 10 months ago · JSON representation ·

Repository

A repo reproducing discrete/discretised Bayesian Flow Networks https://arxiv.org/abs/2308.07037 for MNIST and CIFAR10 datasets

Basic Info
  • Host: GitHub
  • Owner: rupertmenneer
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 106 MB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
bayesian-flow bayesian-flow-networks cifar10 mnist
Created over 2 years ago · Last pushed about 2 years ago
Metadata Files
Readme Citation

README.md

Bayesian Flow Networks

This repo is a simple replication of the discrete and discretised implementations of Bayesian flow networks (BFNs).

CIFAR 10 Sampling

Data Expectation Distribution (Output distribution)

CIFAR 10 data expectation over sampling

Updated Prior (Input distribution)

CIFAR 10 updated prior over sampling

Discretised Examples

Distributions over time

Different distributions over time during training example

Updated Prior & Data Expectation Trajectories and Probability Flow

Discretised 5 bin example, probability flow and example trajectories over time for updated prior.

Discretised 5 bin example, probability flow and example trajectories over time for data expectation.

Discrete Examples

Simplex with 3 Classes, Trajectories over time and Probablity Flow

Bayesian Flow for discrete data visualized on a probability simplex for K=3 classes. White line is the sample trajectory for class 0, which is superimposed on log-scale heatmap of flow distribution over time.

Sampling with different steps

sampling_bfn

Un-conditional inpainting (using something similar to repaint r=20)

inpainting_bfn

Toy examples (discretised) with 5 bins

sample plots

How does BFN work?

We create a 'flow' that uses bayesian updates to transform from a prior to a data sample

Bayesian update frame

During training we learn the flow, from our prior using noisy samples from our data

Training frame

At sampling time we simply swap out our sender distribution with our receiver distribution

Sampling frame

This Repo

  • Replicates BFN with simple toy examples for discrete and discretised datasets.
  • Train a discretised model on the CIFAR-10 dataset (see results above).
  • Provides some math breakdown in the_math.md

The original paper can be found here: https://arxiv.org/pdf/2308.07037.pdf

The official code implementation here: https://github.com/nnaisense/bayesian-flow-networks

This repo was part of a paper replication project at the University of Cambridge 2024.

Owner

  • Name: Rupert Menneer
  • Login: rupertmenneer
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Menneer"
  given-names: "Rupert"
- family-names: "Sinkovics"
  given-names: "Krisztina"
- family-names: "Ou"
  given-names: "Yuxuan"

title: "bayesian_flow"
version: 1.0.0
doi: 10.5281/zenodo.1234
date-released: 2024-03-23
url: "https://github.com/rupertmenneer/bayesian_flow"

GitHub Events

Total
Last Year

Dependencies

requirements.txt pypi
  • matplotlib ==3.8.3
  • packaging ==23.2
  • pillow ==10.2.0
  • scipy ==1.12.0
  • torch ==2.2.1
  • torch-ema ==0.3
  • torchvision ==0.17.1
  • wandb ==0.16.4