energy: Energy of the Deep Belief Net or Restricted Bolzmann Machine.

Description Usage Arguments Value Examples

View source: R/energy.R

Description

Computes the energy of the data points in the DeepBeliefNet or RestrictedBolzmannMachine

Usage

1
2
3
4
5
6
7
energy(x, data, ...)

## S3 method for class 'RestrictedBolzmannMachine'
energy(x, data, drop = TRUE, ...)

## S3 method for class 'DeepBeliefNet'
energy(x, data, drop = TRUE, ...)

Arguments

x

the DeepBeliefNet or RestrictedBolzmannMachine object

data

the dataset, either as matrix or data.frame. The number of columns must match the number of nodes of the network input

...

ignored

drop

do not return additional dimensions

Value

a vector or matrix of the same size than the data (rows) giving the energy of each data point

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(mnist)
data(mnist)

# Calculate error per data point on RBM
data(pretrained.mnist)
rbm <- pretrained.mnist[[1]]
en <- energy(rbm, mnist$test$x)
head(en) # 1 value per data point

# Calculate error per data point on DBN
data(trained.mnist)
en <- energy(trained.mnist, mnist$test$x)
head(en) # 1 value per data point

# Energy is not related with reconstruction error
err <- error(trained.mnist, mnist$test$x)
## Not run: plot.mnist(predictions = cbind(err, en))

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