Deep convolutional generative adverserial network from the paper:

Details

https://arxiv.org/abs/1511.06434

and ported from the Keras (python) implementation:

https://github.com/eriklindernoren/Keras-GAN/blob/master/dcgan/dcgan.py

Arguments

inputImageSize

latentDimension

Details

$initialize instantiates a new class and builds the generator and discriminator. $buildGeneratorbuild generator. $buildGeneratorbuild discriminator.

Author

Tustison NJ

Examples

library( keras ) library( ANTsRNet ) keras::backend()$clear_session()
#> Error in py_discover_config(required_module, use_environment): Python specified in RETICULATE_PYTHON (/Users/ntustison/anaconda3/envs/antsx/bin/python3) does not exist
# Let's use the mnist data set. mnist <- dataset_mnist()
#> Error in py_discover_config(required_module, use_environment): Python specified in RETICULATE_PYTHON (/Users/ntustison/anaconda3/envs/antsx/bin/python3) does not exist
numberOfTrainingData <- length( mnist$train$y )
#> Error in eval(expr, envir, enclos): object 'mnist' not found
inputImageSize <- c( dim( mnist$train$x[1,,] ), 1 )
#> Error in eval(expr, envir, enclos): object 'mnist' not found
x <- array( data = mnist$train$x / 255, dim = c( numberOfTrainingData, inputImageSize ) )
#> Error in array(data = mnist$train$x/255, dim = c(numberOfTrainingData, inputImageSize)): object 'mnist' not found
y <- mnist$train$y
#> Error in eval(expr, envir, enclos): object 'mnist' not found
numberOfClusters <- length( unique( mnist$train$y ) )
#> Error in unique(mnist$train$y): object 'mnist' not found
# Instantiate the DCEC model ganModel <- DeepConvolutionalGanModel$new( inputImageSize = inputImageSize, latentDimension = 100 )
#> Error in initialize(...): object 'inputImageSize' not found
# \donttest{ ganModel$train( x, numberOfEpochs = 2 )
#> Error in eval(expr, envir, enclos): object 'ganModel' not found
# }