SVGD_bayesian_nn: Main Function

Description Usage Arguments Value

View source: R/SVGD_bayesian_nn.R

Description

Main Function

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
SVGD_bayesian_nn(
  X_train,
  y_train,
  eigenMat = diag(x = apply(y_train, 2, var)),
  X_test = NULL,
  y_test = NULL,
  dev_split = 0.1,
  M = 20,
  num_nodes = c(20, 1),
  a0 = 1,
  b0 = 0.1,
  initial_values = FALSE
)

Arguments

X_train

The training dataset variables, a matrix with rows representing observations and columns representing covariates.

y_train

The training dataset outcomes, a vector with the length same as the number of rows of 'X_train'.

eigenMat

the variance matrix of the outcome

X_test

The testing data set variables, a matrix with the same number of columns as 'X_train'.

y_test

The testing dataset outcomes, a vector with the length same as the number of rows of 'X_test'.

M

The number of particles.

num_nodes

The number of nodes in each hidden layer (does not include the last layer, because the node in the last layer is always 1).

a0

a0, for the prior distribution of lambda and gamma.

b0

b0, for the prior distribution of lambda and gamma.

batch_size

The batch size.

max_iter

The maximum number of iterations.

master_stepsize

The master stepsize, which is needed to adjust convergence if using adagrad for optimization of the NN.

auto_corr

The auto correlation, which is needed to adjust convergence if using adagrad for optimization of the NN.

method

The optimization method to be used.

use_autodiff

Whether to use autodiffr, default to FALSE.

Value

A list containing:


BangyaoZhao/svgd documentation built on Sept. 20, 2021, 2:35 a.m.