Description
Usage
Arguments
Value
Author(s)
References
See Also
Examples
View source: R/VAE.R
Setup of a variational autoencoder (VAE) model.
 (, activation = (("relu", ()  2), "sigmoid"),
batch.norm = , dropout.rate = 0,
= 1, loss.type = ("MSE", "binary.cross", "MMD"), nGPU = 0, )

dim 
numeric vector of length at least two, giving
the dimensions of the input layer (equal to the dimension of the
output layer), the hidden layer(s) (if any) and the latent layer (in
this order).

activation 
character vector of length
length(dim)  1 specifying the activation functions
for all hidden layers and the output layer (in this order);
note that the input layer does not have an activation function.

batch.norm 
logical indicating whether batch
normalization layers are to be added after each hidden layer.

dropout.rate 
numeric value in [0,1] specifying
the fraction of input to be dropped; see the rate parameter of
layer_dropout() . Note that only if positive, dropout
layers are added after each hidden layer.

sd 
positive numeric value giving the standard
deviation of the normal distribution used as prior.

loss.type 
character string indicating the type of
reconstruction loss. Currently available are the mean squared error
("MSE" ), binary cross entropy ("binary.cross" )
and (kernel) maximum mean discrepancy ("MMD" ).

nGPU 
nonnegative integer specifying the number of GPUs
available if the GPU version of TensorFlow is installed.
If positive, a (special) multiple GPU model for data
parallelism is instantiated. Note that for multilayer perceptrons
on a few GPUs, this model does not yet yield any scaleup computational
factor (in fact, currently very slightly negative scaleups are likely due
to overhead costs).

... 
additional arguments passed to loss() .

VAE_model()
returns a list with components
model
:VAE model (a keras object inheriting from
the classes "keras.engine.training.Model"
,
"keras.engine.network.Network"
,
"keras.engine.base_layer.Layer"
and "python.builtin.object"
).
encoder
:the encoder (a keras object as
model
).
generator
:the generator (a keras object as
model
).
type
:character
string indicating
the type of model ("VAE"
).
dim
:see above.
activation
:see above.
batch.norm
:see above.
dropout.rate
:see above.
sd
:see above.
loss.type
:see above.
dim.train
:dimension of the training data (NA
unless trained).
batch.size
:batch size (NA
unless trained).
nepoch
:number of epochs (NA
unless trained).
Marius Hofert and Avinash Prasad
Kingma, D. P. and Welling, M. (2014).
Stochastic gradient VB and the variational autoencoder.
Second International Conference on Learning Representations (ICLR).
See https://keras.rstudio.com/articles/examples/variational_autoencoder.html
GMMN_model()
 # to avoid winbuilder error "Error: Installation of TensorFlow not found"
## Example model with a 5d input, 300d hidden and 4d output layer
(((5, 300, 4)))

gnn documentation built on March 13, 2020, 5:07 p.m.