Comments (7)
I found this comment in pix2pix paper In addition, we divide the objective by 2 while optimizing D, which slows down the rate at which D learns relative to G.
and in cyclegan paper In practice, we divide the objective by 2 while optimizing D, which slows down the rate at which D learns, relative to the rate of G.
Actually I have tested it without 0.5 on simple dataset like parabola from here and it still works.
from keras-gan.
Loss from real and fake images are averaged. CMIIW, I guess this is how loss is calculated in the paper but if we just sum the loss then also we might get the same result.
from keras-gan.
Discriminator use BCE loss:
BCE = - y * log(y_pred) - (1 - y) * log(1 - y_pred)
as I understand we can rewrite this code https://github.com/eriklindernoren/Keras-GAN/blob/master/gan/gan.py#L121-L122 as d_loss = self.discriminator.train_on_batch([gen_imgs, imgs], [fake, valid])
, by [gen_imgs, imgs]
here I mean concatenate.
I guess this is how loss is calculated in the paper
Can you point out where it's specified in the paper?
from keras-gan.
Actually I was not able to break it even with d_loss = 100000.0 * np.add(d_loss_real, d_loss_fake)
, as I understand in this keras code it's not affect the training procedure, but just just averages metrics for display.
from keras-gan.
Multiplying loss with a constant will have same effect as that of a learning rate. While training a GAN we two try that both generator and discriminator learns at the same pace.
from keras-gan.
I mean as I understand in Keras if you want to apply weight to loss you should use loss_weights
in compile
https://github.com/eriklindernoren/Keras-GAN/blob/master/gan/gan.py#L29-L31
loss_weights: Optional list or dictionary specifying scalar
coefficients (Python floats) to weight the loss contributions
of different model outputs.
The loss value that will be minimized by the model
will then be the *weighted sum* of all individual losses,
weighted by the `loss_weights` coefficients.
If a list, it is expected to have a 1:1 mapping
to the model's outputs. If a tensor, it is expected to map
output names (strings) to scalar coefficients.
but if you already get metrics, you just multiply them by constant here https://github.com/eriklindernoren/Keras-GAN/blob/master/gan/gan.py#L123 and it's not affecting the training process, I mean this multiplication is not 'part of the graph' like for example in tensorflow.
from keras-gan.
I come here for the same question.
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
- 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.