PredictRBM: Predict RBM

Description Usage Arguments Value Examples

Description

Function for predicting on a test set with either a classification RBM (trained with the RBM function) or a stacked RBM with a classification RBM on top (trained with StackRBM).

Usage

1
PredictRBM(test, labels, model, layers = 2)

Arguments

test

Is the test-data (matrix) on which the user wants to make predictions.

labels

Is a matrix with the corresponding labels for test-data.

model

Is the trained RBM or StackRBM model.

layers

Only needed with StackRBM to define the number of layers.

Value

A list with a confusion matrix and the accuracy of the predictions.

Examples

1
2
3
4
5
6
7
8
# Load MNIST data
data(MNIST)

# First train supervised RBM or StackedRBM
mod <- RBM(MNIST$trainX, MNIST$trainY, n.iter = 1000, n.hidden = 1000)

# Then use PredictRBM to make predictions
PredictRBM(MNIST$testX, MNIST$testY, model = mod)

TimoMatzen/RBM documentation built on June 1, 2019, 8:35 a.m.