Comments (4)
Actually, there are 2 generators G and F which are trained separately. Each generator loss is a sum of GAN loss and cycle loss.
from cyclegan-tensorflow.
Yes, but isn't cycle loss for G (which takes x as input, and produces G(x) as output) "forward_loss = tf.reduce_mean(tf.abs(F(G(x))-x))"
And cycle loss for F "tf.reduce_mean(tf.abs(G(F(y))-y))"
When you defined "cycle_loss = self.cycle_consistency_loss(self.G, self.F, x, y)" on line 72, I thought you've already written this loss as sum of two cycle losses for each generator
from cyclegan-tensorflow.
The original paper and PyTorch implementation optimize F and G simultaneously, so there is only 1 objective function for 2 generators:
L(G, F) = L_gan(G) + L_gan(F) + L_cycle
# optimize
AdamOptimizer(L(G, F))
But my implementation is based on the Torch implementation. If I understand correctly, loss of G and loss of F are computed separately as follows:
# compute losses
L_forward: x → G(x) → F(G(x)) ≈ x
L_backward: y → F(y) → G(F(y)) ≈ y
L_cycle = L_forward + L_backward
L(G) = L_gan(G) + L_cycle
L(F) = L_gan(F) + L_cycle
# optimize separately
AdamOptimizer(L(G))
AdamOptimizer(L(F))
from cyclegan-tensorflow.
I see what you mean now. Both cycles need to be taken into account for each generator
from cyclegan-tensorflow.
Related Issues (20)
- Missing the ngf parameter for F generator HOT 2
- CPU 100%, but training never starts HOT 2
- verbosity error HOT 4
- can be used to remove the watermark ? HOT 1
- Nothing in cityscapes downloaded by download_dataset.sh HOT 1
- Error happen trying to export. HOT 1
- Control dependencies in CycleGAN optimizer
- image size, default: 256
- 怎么使用预训练的模型啊
- Observing backward pass while running inference.py with a pb file, which is consuming lot of time
- NO FILE IN THE Checkpoints AFTER Train
- ops.py重的Instance Normalization是不是有个地方搞错了? HOT 2
- Use python train.py --load_model XXXX problem
- can this
- Can this code work with gray scale image or rectangle img?
- How to deal with high contrast background colors?
- How to convert the ckpt model into savedmodel HOT 1
- The training doesn't start
- Training doesn't start HOT 1
- pretrained examples: freezed or not? any data preprocessing?
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 cyclegan-tensorflow.