prior.gaussian {BayesFluxR} | R Documentation |
Use an isotropic Gaussian prior
Description
Use a Multivariate Gaussian prior for all network parameters. Covariance matrix is set to be equal 'sigma * I' with 'I' being the identity matrix. Mean is zero.
Usage
prior.gaussian(chain, sigma)
Arguments
chain |
Chain obtained using |
sigma |
Standard deviation of Gaussian prior |
Value
a list containing the following
'juliavar' the julia variable used to store the prior
'juliacode' the julia code
Examples
## Not run:
## Needs previous call to `BayesFluxR_setup` which is time
## consuming and requires Julia and BayesFlux.jl
BayesFluxR_setup(installJulia=TRUE, seed=123)
net <- Chain(Dense(5, 1))
like <- likelihood.feedforward_normal(net, Gamma(2.0, 0.5))
prior <- prior.gaussian(net, 0.5)
init <- initialise.allsame(Normal(0, 0.5), like, prior)
x <- matrix(rnorm(5*100), nrow = 5)
y <- rnorm(100)
bnn <- BNN(x, y, like, prior, init)
sampler <- sampler.SGLD()
ch <- mcmc(bnn, 10, 1000, sampler)
## End(Not run)
[Package BayesFluxR version 0.1.3 Index]