question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello,

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: image

Eq. 7: image 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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rdevoncommented, Jul 9, 2019

I think it’s an artifact of the olden days of Theano, as I’m guessing in PyTorch these are equivalent.

0reactions
SkyeLucommented, Jul 24, 2019

Oh sorry, I think you have done this maximize procedure in class Discriminator. Sorry to disturb.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found