Code vs paper
See original GitHub issueHello,
thank you for publishing your code - outstanding work 😃 However I have a question regarding JSD/GAN based estimators and differences between implementation and formulation in your paper: Eq. 4:
Eq. 7: At the same time, in your code: (for the JSD estimator)
if mode == 'fd':
loss = fenchel_dual_loss(l_enc, m_enc, measure=measure)
[...]
E_pos = get_positive_expectation(u, measure, average=False).mean(2).mean(2)
E_neg = get_negative_expectation(u, measure, average=False).mean(2).mean(2)
[...]
Ep = log_2 - F.softplus(-p_samples) # Note JSD will be shifted
Eq = F.softplus(-q_samples) + q_samples - log_2 # Note JSD will be shifted
While I do know, where does thie log_2 come from [Nowozin et al., 2016], the addition of q_samples in Eq
is a bit more mysterious 😄
And then for the prior matching:
if not loss_type or loss_type == 'minimax':
return get_negative_expectation(q_samples, measure)
elif loss_type == 'non-saturating':
return -get_positive_expectation(q_samples, measure)
Seems like you are using just half of the equation 7 to obtain loss value.
Could you clarify those differences (maybe I am missing something in the code)? I have been trying to merge DIM with my existing code (a bit different setup, yet should work together properly) and cannot get it to work well.
Thanks in advance!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Papers With Code: The latest in Machine Learning
Papers With Code highlights trending Machine Learning research and the code to implement it.
Read more >What is the difference between writing code on paper ... - Quora
Any one can write code with any text editor…notepad even. An IDE just simplifies some repetitive or time consuming tasks that can be...
Read more >Why (and How) I Write Code With Pencil and Paper - CSS-Tricks
The purpose of writing down ideas, design issues, handwriting code (and/or pseudo-code) is to work through design and logic in advance.
Read more >Why Do We Write Code on Paper :: ClasCube.com
Many teachers and professors have their students write at least some of their code on paper, and then it's hand graded rather than...
Read more >Electronic vs. Paper Coding for Billers and Coders
This video will explain some of the qualities of this coding software, and will show you how coding electronically will save you time...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it’s an artifact of the olden days of Theano, as I’m guessing in PyTorch these are equivalent.
Oh sorry, I think you have done this maximize procedure in class Discriminator. Sorry to disturb.