WassersteinGanModel | R Documentation |
Wasserstein generative adverserial network from the paper:
https://arxiv.org/abs/1701.07875
and ported from the Keras (python) implementation:
https://github.com/eriklindernoren/Keras-GAN/blob/master/wgan/wgan.py
$initialize
instantiates a new class and builds the
generator and critic.
$buildGenerator
build generator.
$buildGenerator
build critic.
Tustison NJ
library( keras )
library( ANTsRNet )
keras::backend()$clear_session()
# Let's use the mnist data set.
mnist <- dataset_mnist()
numberOfTrainingData <- length( mnist$train$y )
inputImageSize <- c( dim( mnist$train$x[1,,] ), 1 )
x <- array( data = mnist$train$x / 255, dim = c( numberOfTrainingData, inputImageSize ) )
y <- mnist$train$y
numberOfClusters <- length( unique( mnist$train$y ) )
# Instantiate the WGAN model
ganModel <- WassersteinGanModel$new(
inputImageSize = inputImageSize,
latentDimension = 100 )
ganModel$train( x, numberOfEpochs = 5 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.