Description Usage Arguments Value Examples
Function for predicting on a test set with a Deep Belief Network (Trained with DBN)
1 | PredictDBN(test, labels, model, layers)
|
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. |
A list with a confusion matrix and the accuracy of the predictions.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.