Variational Inference
BFlux.bbb
— Functionbbb(args...; kwargs...)
Use Bayes By Backprop to find Variational Approximation to BNN.
This was proposed in Blundell, C., Cornebise, J., Kavukcuoglu, K., & Wierstra, D. (2015, June). Weight uncertainty in neural network. In International conference on machine learning (pp. 1613-1622). PMLR.
Arguments
bnn::BNN
: The Bayesian NNbatchsize::Int
: Batchsizeepochs::Int
: Epochs
Keyword Arguments
mc_samples::Int=1
: Over how many gradients should be averaged?shuffle::Bool=true
: Should observations be shuffled after each epoch?partial::Bool=true
: Can the last batch be smaller than batchsize?showprogress::Bool=true
: Show progress bar?opt=Flux.ADAM()
: Must be an optimiser of type Flux.Optimisern_samples_convergence::Int=10
: After each epoch the loss is calculated and kept track of using an average ofn_samples_convergence
samples.