Skip to content

A Generative Adversarial Network (GAN) that generates handwritten digits(0 to 9). Uses mnist dataset. Written in R

Notifications You must be signed in to change notification settings

Aypak/tf_gan_handwritten_digits

Repository files navigation

Generative Adversarial Network to generate handwritten digits

Uses mnist dataset

How to use:

  • Install packages
install.packages(c("tensorflow", "keras", "tfdatasets"))

library(tensorflow)
install_tensorflow()

If a GPU is available:

install_tensorflow(version = "gpu")

Use tensorflow eager execution

library(keras)
use_implementation("tensorflow")

library(tensorflow)
tfe_enable_eager_execution(device_policy = "silent")

library(tfdatasets)
  • Run the main.R file
  • (Optional) Set the number of epochs to train and number of examples to generate (found in main.R)

Sample generated images after training for 50 epochs

generated_imgs

References

Keydana (2018, Aug. 26). RStudio AI Blog: Generating images with Keras and TensorFlow eager execution. Retrieved from https://blogs.rstudio.com/tensorflow/posts/2018-08-26-eager-dcgan/

About

A Generative Adversarial Network (GAN) that generates handwritten digits(0 to 9). Uses mnist dataset. Written in R

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages