make_net: Create a BNN based on a specification

View source: R/quickbnnr.R

make_netR Documentation

Create a BNN based on a specification

Description

Specification must be a valid ChainBNN description from the QuickBNN.jl package. This can be created using the Chain function and any of the provided layer types, such as DenseBNN

Usage

make_net(specification)

Arguments

specification

QuickBNN.jl ChainBNN specification; Can be created using Chain

Examples

y <- arima.sim(list(ar = 0.5), n = 500)
x <- matrix(y[1:499], nrow = 1)
y <- y[2:500]
quickbnnr_setup()
net <- Chain(DenseBNN(1, 1, "sigmoid"), DenseBNN(1, 1))
net <- make_net(net)
model <- BNN(net, y, x)
chains <- estimate(model, niter = 100, nchains = 4)

# library(bayesplot)
# mcmc_intervals(chains$draws)


enweg/quickbnnr documentation built on April 15, 2022, 3:29 a.m.