Skip to content

josephrocca/tfjs-acgan-browser-training

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TFjs ACGAN Browser Training

Train an Auxiliary Classifier GAN (ACGAN) in a browser tab with TensorFlow.js:

josephrocca.github.io/tfjs-acgan-browser-training/train.html

In a "vanilla" GAN we give the generator some random numbers as input, and it converts them into an image. The discriminator is then given these images, along with real images, and outputs a "realness" score. Each training step, we alter the weights of the discriminator (with backpropagation) so that its realness score is more accurate, and we alter the weights of the generator so it's more likely to trick the discriminator. Once we've finished training the whole network, we can throw away the discriminator part and just feed random numbers into the generator, and it'll generate random images for us.

The difference with an ACGAN is that we also give the generator an input that corresponds to the class of the image that we want it to generate (in this case, a MNIST digit), and the discriminator has a second output (alongside the realness score) which tries to classify the images that we give it. Both the realness score and the classification are factored into the "loss" which we use to direct our weight updates. So once we've trained the network, we can feed random numbers to the generator, along with a specific class number, and it'll generate that specific digit class from our dataset, rather than just a random MNIST digit.

"Auxiliary" means "additional" or "supporting", so the name "Auxiliary Classifier GAN" refers to the fact that the discriminator has this additional classifier built in.

About

Train an Auxiliary Classifier GAN (ACGAN) in a browser tab with tensorflow.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published