Model Basics

BayesFlux.BNNType
BNN(x, y, like::BNNLikelihood, prior::NetworkPrior, init::BNNInitialiser)

Create a Bayesian Neural Network.

Arguments

  • x: Explanatory data
  • y: Dependent variables
  • like: A likelihood
  • prior: A prior on network parameters
  • init: An initilialiser
BayesFlux.NetConstructorType
NetConstructor{T, F}

Used to construct a network from a vector.

The NetConstructor constains all important information to construct a network like the original network from a given vector.

Fields

  • num_params_net: Number of network parameters
  • θ: Vector of network parameters of the original network
  • starts: Vector containing the starting points of each layer in θ
  • ends: Vector containing the end points of each layer in θ
  • reconstructors: Vector containing the reconstruction functions for each layer
BayesFlux.destructFunction
destruct(net::Flux.Chain{T}) where {T}

Destruct a network

Given a Flux.Chain network, destruct it and create a NetConstructor. Each layer type must implement a destruct method taking the layer and returning a vector containing the original layer parameters, and a function that given a vector of the right length constructs a layer like the original using the parameters given in the vector