c: Combine DeepBeliefNets, RestrictedBolzmannMachines and Layers...

Description Usage Arguments Value Examples

Description

This function combines one or more DeepBeliefNets, RestrictedBolzmannMachines and Layers into a single DeepBeliefNets.

The layers must be compatible in order, i.e. the output of the previous DBN/RBM must be the same (both in term of size and type) than the input of the next one. The only exception is with Layer objects, where RestrictedBolzmannMachines will be created before and after the layer (only one RestrictedBolzmannMachine is created Layer succeeding immediately an other Layer).

Usage

1
2
## S3 method for class 'DeepBeliefNet'
c(..., biases.first = TRUE)

Arguments

...

objects to be combined

biases.first

whether to use the biases of RBM i (TRUE) or i+1 (FALSE) for shared layers. Defaults to TRUE as we don't care much about the Bs after the pre-training.

Value

the combined DBN. Note that it is not tagged as unrolled and fine-tuned any more. It is tagged as pre-trained if all individual DBNs/RBMs were pre-trained.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# DeepBeliefNets only
dbn1 <- DeepBeliefNet(Layers(c(784, 1000), input="continuous", output="binary"))
dbn2 <- DeepBeliefNet(Layers(c(1000, 500, 250), input="binary", output="binary"))
dbn <- c(dbn1, dbn2)

# RestrictedBolzmannMachines only
dbn <- c(dbn1[[1]], dbn2[[1]], dbn2[[2]])

# Layers only
dbn <- c(Layer(784, "continuous"), Layer(1000, "binary"), Layer(500, "gaussian"))

# Layers only
c(Layer(784, "continuous"), Layer(1000, "binary"), Layer(500, "binary"))

# Mixing it all
rbm3 <- RestrictedBolzmannMachine(Layer(250, "binary"), Layer(30, "binary"))
layer4 <- Layer(2, "gaussian")
c(Layer(2, "gaussian"), dbn1, dbn2, rbm3, layer4)

# The following won't work
## Not run: 
dbn3 <- DeepBeliefNet(Layers(c(250, 500), input="binary", output="binary"))
dbn <- c(dbn1, dbn3)
dbn4 <- DeepBeliefNet(Layers(c(1000, 500), input="continuous", output="binary"))
dbn <- c(dbn1, dbn4)

## End(Not run)

xrobin/DeepLearning documentation built on May 17, 2018, 3:51 a.m.