predict: Predict Methods for Deep Belief Nets and Restricted Bolzman...

Description Usage Arguments Examples

Description

Obtain predictions from a DeepBeliefNet or RestrictedBolzmannMachine object

Usage

1
2
3
4
5
6
## S3 method for class 'DeepBeliefNet'
predict(object, newdata, drop = TRUE, ...)

## S3 method for class 'RestrictedBolzmannMachine'
predict(object, newdata, drop = TRUE,
  ...)

Arguments

object

the model

newdata

a data.frame or matrix providing the data. Must have the same columns than the input layer of the model.

drop

do not return additional dimensions

...

ignored

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(mnist)
data(mnist)
## Make predictions on a DBN object
data(trained.mnist)
predict(trained.mnist, mnist$test$x[1:10,])
## Make predictions on a RBM object
data(pretrained.mnist)
rbm <- pretrained.mnist[[1]]
predictions <- predict(rbm, mnist$test$x)
dim(predictions) # 1000 columns, output size of the rbm
ncol(predictions) == rbm$output$size

xrobin/DeepLearning documentation built on Sept. 18, 2020, 5:23 a.m.