Skip to content

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

Notifications You must be signed in to change notification settings

rupertmenneer/bayesian_flow

Repository files navigation

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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published