BLNN_Build: Build a Feed-Forward Neural Network Structure

Description Usage Arguments Details Value

View source: R/BLNN_Build.R

Description

Allows the user to generate a neural network structure for the purposes of training and predicting.

Usage

1
2
3
4
5
BLNN_Build(ncov, nout, hlayer_size = 1, actF = c("linear", "sigmoid",
  "tanh"), costF = c("MSE", "crossEntropy"), outF = c("linear",
  "sigmoid", "softmax"), bias = c(1, 1), hp.Err = FALSE,
  hp.W1 = FALSE, hp.W2 = FALSE, hp.B1 = FALSE, hp.B2 = FALSE,
  decay_term = 1)

Arguments

ncov

An integer, the number of input units.

nout

An integer, the number of output units.

hlayer_size

An integer, the number of nodes making up the hidden layer. Default is 1.

actF

The choice of activation function. See 'Details'.

costF

The choice of cost function. See 'Details'.

outF

The choice of output function. See 'Details'.

bias

The choice for the bias term of each layer. Default is 1 for each layer.

hp.Err

Value of the scale hyperparameter for the network errors. Defaults to FALSE for no bayesian.

hp.W1

Value of the scale hyperparameter for the first layer weights. Defaults to FALSE for no bayesian.

hp.W2

Value of the scale hyperparameter for the second layer weights. Defaults to FALSE for no bayesian.

hp.B1

Value of the scale hyperparameter for the first layer bias. Defaults to FALSE for no bayesian.

hp.B2

Value of the scale hyperparameter for the second layer bias. Defaults to FALSE for no bayesian.

decay_term

Control term for the initial valus of the weights. Standard deviation of initial weights is 1/decay_term. Default is 1.

Details

BLNN_Build provides users with different activation, cost, and output finctions which can be chosen based on the model type. Activation functions are applied at the hidden layer in order to assist in computation where the output function restricts the range of values to fit the given problem. We recomend using tanh in the activation function in most cases. MSE can be used when taking the error of linear outputs but cross entropy is suggested otherwise.

Value

The network object, defined as a list containing

ncov

Number of covariates.

nout

Number of outputs.

hidden_size

Size of the hidden layer.

actF

Activation Function.

costF

Cost Function.

outF

Output Function.

bias

Bias terms.

scale.error

Error hyperparameter.

scale.weights

A list containing weight and bias hyperparameters.

weights

A list containing each layer's weight matrix.

Amat

A placeholder to contain weights1 multiplied by inputs.

postAmat

A placeholder to contain actF evaluated at Amat.

Zmat

A placeholder to contain weights2 multiplied by postAmat.

trainout

A placeholder to contain trained output values.


BLNNdevs/BLNN documentation built on Dec. 10, 2019, 3:31 a.m.