Comments (3)
-
Epoch might be a slightly misleading variable name honestly. That's something I should change. For each iteration I randomly sample images with uniform probability, so when the number of iterations rises to a sufficiently large number the model will have seen each sample. Therefore I didn't see a reason to divide the training into epochs and batch iterations. MNIST consists of 60k samples, so iterating through the whole dataset during one epoch would take a lot of time. And the models I have implemented that are modelling MNIST converge relatively quickly, so therefore I randomly sample instead.
-
When BatchNormalization2d is used it's recommended to split the data into real and fake batches before feeding them to the discriminator. It's been a while since I read up on why but since batch norm keeps a running average of batch means and variances I guess mixing batches with data from two distributions messes with these running averages. There are a lot of tricks listed in this great repo: https://github.com/soumith/ganhacks. Dividing real and fake batches when batch norm is used is one trick listed there.
from keras-gan.
Thanks so much for the help Erik, super cool.
from keras-gan.
First, thank you for sharing this code, @eriklindernoren!
Regarding the misleading use of the word epoch, it is indeed confusing for newcomers. I guess people who run the code in your repository come from the Keras documentation, so they have this vocabulary in mind:
Epoch: an arbitrary cutoff, generally defined as "one pass over the entire dataset", used to separate training into distinct phases, which is useful for logging and periodic evaluation.
Batch: a set of N samples. The samples in a batch are processed independently, in parallel. If training, a batch results in only one update to the model.
Now, it makes more sense that the number of so-called epochs in your code is so large! And if I were to apply your code to another dataset of 30k samples, I might want to lower the value of the so-called epochs to account for the lower number of samples.
from keras-gan.
Related Issues (20)
- when training CGAN, raise AttributeError: 'list' object has no attribute 'keys' in the following code HOT 5
- About pix2pix cannot be executed
- [Pix2Pix] Use fit_generator to speed up training process
- Why d_loss = 0.5 * np.add(d_loss_real, d_loss_fake) ? HOT 7
- cGAN: Using Multi label with different number of classes
- DCGAN can only generate noise images HOT 5
- (WGAN_GP)BatchNormalization in critic
- Adversarial Autoencoder training procedure does not correspond to procedure described in paper
- SRGAN - Generated image got PINK overlay all the time ? How to solve this ? HOT 1
- StarGAN & StyleGAN any chance ?
- Cannot import 'Adam' for keras optimizers while testing acgan HOT 1
- ACGAN: Difference multiplication and concatenation of embedding and noise
- pix2pix download dataset
- ImportError: cannot import name 'DataLoader' from 'data_loader'
- Where can I find and download some pre-trained model?
- Project dependencies may have API risk issues
- SRGAN dataset is not available
- when training SGAN for cifar10 and mnist dataset, raised the "AttributeError: 'list' object has no attribute 'keys' "in the following code lones
- cGAN with multi-labels of multi-classes HOT 1
- Keras GAN
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras-gan.