# Implementation of Bayesian Neural Networks

## Documentation for package ‘BayesFluxR’ version 0.1.3

- DESCRIPTION file
- Package NEWS
- Package README

## Help Pages

.install_pkg | Installs Julia packages if needed
.julia_project_status | Obtain the status of the current Julia project
.set_seed | Set a seed both in Julia and R
.using | Loads Julia packages
BayesFluxR_setup | Set up of the Julia environment needed for BayesFlux
bayes_by_backprop | Use Bayes By Backprop to find Variational Approximation to BNN.
BNN | Create a Bayesian Neural Network
BNN.totparams | Obtain the total parameters of the BNN
Chain | Chain various layers together to form a network
Dense | Create a Dense layer with 'in_size' inputs and 'out_size' outputs using 'act' activation function
find_mode | Find the MAP of a BNN using SGD
Gamma | Create a Gamma Prior
get_random_symbol | Creates a random string that is used as variable in julia
initialise.allsame | Initialises all parameters of the network, all hyper parameters of the prior and all additional parameters of the likelihood by drawing random values from 'dist'.
InverseGamma | Create an Inverse-Gamma Prior
likelihood.feedforward_normal | Use a Normal likelihood for a Feedforward network
likelihood.feedforward_tdist | Use a t-Distribution likelihood for a Feedforward network
likelihood.seqtoone_normal | Use a Normal likelihood for a seq-to-one recurrent network
likelihood.seqtoone_tdist | Use a T-likelihood for a seq-to-one recurrent network.
LSTM | Create an LSTM layer with 'in_size' input size, and 'out_size' hidden state size
madapter.DiagCov | Use the diagonal of sample covariance matrix as inverse mass matrix.
madapter.FixedMassMatrix | Use a fixed mass matrix
madapter.FullCov | Use the full covariance matrix as inverse mass matrix
madapter.RMSProp | Use RMSProp to adapt the inverse mass matrix.
mcmc | Sample from a BNN using MCMC
Normal | Create a Normal Prior
opt.ADAM | ADAM optimiser
opt.Descent | Standard gradient descent
opt.RMSProp | RMSProp optimiser
posterior_predictive | Draw from the posterior predictive distribution
prior.gaussian | Use an isotropic Gaussian prior
prior.mixturescale | Scale Mixture of Gaussian Prior
prior_predictive | Sample from the prior predictive of a Bayesian Neural Network
RNN | Create a RNN layer with 'in_size' input, 'out_size' hidden state and 'act' activation function
sadapter.Const | Use a constant stepsize in mcmc
sadapter.DualAverage | Use Dual Averaging like in STAN to tune stepsize
sampler.AdaptiveMH | Adaptive Metropolis Hastings as introduced in
sampler.GGMC | Gradient Guided Monte Carlo
sampler.HMC | Standard Hamiltonian Monte Carlo (Hybrid Monte Carlo).
sampler.SGLD | Stochastic Gradient Langevin Dynamics as proposed in Welling, M., & Teh, Y. W. (n.d.). Bayesian Learning via Stochastic Gradient Langevin Dynamics. 8.
sampler.SGNHTS | Stochastic Gradient Nose-Hoover Thermostat as proposed in
summary.BNN | Print a summary of a BNN
tensor_embed_mat | Embed a matrix of timeseries into a tensor
to_bayesplot | Convert draws array to conform with 'bayesplot'
Truncated | Truncates a Distribution
vi.get_samples | Draw samples form a variational family.