PredictDBN: Predict DBN

Description Usage Arguments Value Examples

Description

Function for predicting on a test set with a Deep Belief Network (Trained with DBN)

Usage

1
PredictDBN(test, labels, model, layers)

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 DBN model.

layers

Defines 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
9
# Load the MNIST data
data(MNIST)

# Train the DBN model
modDBN <- DBN(MNIST$trainX, MNIST$trainY,n.iter = 500, nodes = c(500, 300, 150), learning.rate = 0.5,
size.minibatch = 10, n.iter.pre = 300, learning.rate.pre = 0.1, verbose = FALSE)

# Make predictions with PredictDBN
PredictDBN(MNIST$testX, MNIST$testY, model = modDBN, layers = 4)

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