resample: Sampling Methods for Deep Belief Nets and Restricted Bolzman...

Description Usage Arguments Examples

View source: R/resample.R

Description

Sample from a DeepBeliefNet or RestrictedBolzmannMachine object

Usage

1
2
3
4
5
6
7
8
resample(...)

## S3 method for class 'DeepBeliefNet'
resample(object, newdata, drop = TRUE, ...)

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

Arguments

...

ignored

object

the model

newdata

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

drop

do not return additional dimensions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(mnist)
data(mnist)
## Make predictions on a DBN object
data(pretrained.mnist)
res <- resample(pretrained.mnist, mnist$test$x)
dim(res)
head(res)
# Contrast with predict
pred <- predict(pretrained.mnist, mnist$test$x)
dim(pred)
head(pred)

## Sample an RBM object
rbm <- pretrained.mnist[[1]]
res <- resample(rbm, mnist$test$x)
dim(res)

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