Comments (5)
@amjltc295 Thank you for your interest in our work.
-
All different GAN losses are still active and being used by the community and each has its own merits. Minimizing the original GAN loss is shown to be equal to minimizing Jensen-Shannon divergence. But it works poorly on early iterations due to small gradient and is very unstable when both networks become more powerful, again due to large gradients! The NSGAN, or the non-saturating version of GAN, is a heuristic solution to the problem by changing the problem from minimizing the log probability of the correct answer to maximize the log probability of the wrong answer!
The LSGAN, or least squares GAN, is shown to be equal to minimizing the f-divergence! This loss function is also more robust to mode collapse! In our experiments, we found NSGAN to converge faster, and our model is not susceptible to mode collapse due to conditioning partially on input edge maps. That's why we used NSGAN in all experiments!
The Hige loss version of GAN is a new player in town! We just implemented it and didn't really experiment with it until recently! This loss function works great in the presence of spectral normalization module! In our recent experiments, although converges slower, this loss function produces much sharper edges and results in much better precision and recall for the edge maps! -
All pre-trained weights are trained with NSGAN. We will be releasing a new set of weights once we complete our new experiments.
-
The loss values that you are getting are normal. GAN in a way is a min-max game, which means losses will oscillate around some values. In a way, that's what you want: two players both getting stronger together. If one of the networks becomes much stronger then the other, learning stops and you'll see unbalance loss values. The learning curve of GAN loss is expected to be flat line with lots of oscillation around its mean! It's better to monitor some other performance measure to validate the quality/learning of the procedure!
from edge-connect.
Thanks for your detailed reply :)
from edge-connect.
dear, @knazeri . you really did a great job.
look at line 106 and line 115 code in models.py when training edge generator.
"dis_input_fake = torch.cat((images, outputs.detach()), dim=1)... dis_fake, dis_fake_feat = self.discriminator(dis_input_fake)"
and " gen_input_fake = torch.cat((images, outputs), dim=1)... gen_fake, gen_fake_feat = self.discriminator(gen_input_fake)"
I think gen_fake_feat is same as dis_fake_feat, why repeat compute that?
look forward your reply.
em. the difference is the detach(), so they are not same. then when update discriminator, generator's params is fixed, but when update generator params, discriminator is also updated. Is it right?
from edge-connect.
dear, @knazeri . you really did a great job.
look at line 106 and line 115 code in models.py when training edge generator.
"dis_input_fake = torch.cat((images, outputs.detach()), dim=1)... dis_fake, dis_fake_feat = self.discriminator(dis_input_fake)"
and " gen_input_fake = torch.cat((images, outputs), dim=1)... gen_fake, gen_fake_feat = self.discriminator(gen_input_fake)"
I think gen_fake_feat is same as dis_fake_feat, why repeat compute that?
look forward your reply
from edge-connect.
@tengshaofeng I don't think so.
When updating D, outputs.detach
is used to cut off the gradient flow so that G could be fixed in this way.
While updating G, despite parameters in D partly contribute to the gen_loss
term, the update step self.gen_optimizer.step()
is defined as follows:
self.gen_optimizer = optim.Adam(
params=generator.parameters(),
lr=float(config.LR),
betas=(config.BETA1, config.BETA2)
)
this suggests that only parameters in G will be updated via Adam optimizer.
from edge-connect.
Related Issues (20)
- Test image is being filled in a lighter shade HOT 1
- Who can help me slove this error? (when I try to train ) HOT 5
- Run the program on CoLab
- Convergency of edge model HOT 10
- Hello, After reading your paper, may I have a question that why you choice 178 for the celebA dataset drop size.
- 如果对图像修复,edge-connect感兴趣,或者需要帮助,可以联系我
- Training on Google Colab immediately stops HOT 1
- Selection of dataset
- Canny sigma HOT 1
- how to implement the visualization for the learned edges? HOT 2
- Sizes of tensors must match except in dimension 1
- New easy to use inpanting method with transformers HOT 1
- When using edge=2, training has ValueError: operands could not be broadcast together with shapes (256,256,3) (256,256)
- Why is there an error when I train MODEL4: joint model/为什么我训练MODEL4 :joint model会报错
- When I tried to start training, I got an error:RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 512, 4, 4]] is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True). HOT 15
- About precision and recall during training HOT 1
- The loss function is abnormal when the edge network is trained
- RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
- a question
- Edge Model Not converging
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 edge-connect.