model annotation

Entry point for the adversarial family, implemented in lib/AdversarialFactors.jl.

The paper’s thesis in one line: without a likelihood you must learn by comparison, and every way of comparing two distributions you can only sample from reduces to estimating a density ratio or difference.

Its relevance here is not GANs. It is that a density ratio is exactly what messages now accepts for pooling with explicit particles (LP-016).

Sources: Mohamed & Lakshminarayanan, Learning in Implicit Generative Models (arXiv:1610.03483)

Bibliography: Mohamed & Lakshminarayanan 2016

Theory (CT-ML wiki): Bayesian Inversion · Bayesian Lens · Variational Free Energy · Lens

1. The definition

An implicit generative model specifies a sampling procedure and no density:

You can draw . You cannot evaluate — doing so would require the change-of- variables formula, which needs invertible with a tractable Jacobian determinant. (A normalising flow is exactly the case where you pay for that; see Three Senses of Implicit §2 for why that makes a flow not implicit in this sense.)

This is a different sense of “implicit” from README’s, and conflating the two is the subject of Three Senses of Implicit. In short: an implicit generative model gives up the density and keeps the direction; an implicit learner gives up the direction.

2. Learning by comparison

No likelihood ⇒ no maximum likelihood. What is left is to compare the model with the truth using only samples from each, and drive the comparison to indifference. The paper organises the ways of doing that into four, all of which turn out to estimate the same object:

approachestimatesgives you
class-probability estimation via a classifierGANs
divergence minimisationan -divergence via its variational bound-GAN
ratio matching directly, by least squaresLSQ ratio estimation
moment matchingdifferences of feature expectationsMMD / GMMN

The unifying object is the density ratio , and the paper’s point is that all four are ways of getting at it without either density.

There is a second connection the paper draws that is worth keeping in view: this is the same problem as likelihood-free inference / ABC in statistics, where a simulator plays the role of . Which means the machinery here is not a deep-learning trick — it is the established answer to “I have a simulator and no likelihood”.

3. The identity that makes it work

Train a classifier to separate (label 1) from (label 0) with equal class priors. At the optimum

The logit of the optimal discriminator is the log density ratio. Everything else in the GAN literature is a consequence of this line plus a choice of what to do with .

AdversarialFactors.RatioFactor is this identity as a factor: logratio and discriminator are the two readings of one number, and the test suite checks them against a closed-form Gaussian pair, where the optimal discriminator’s logit is a known quadratic.

4. What it looks like as factors

Three factors, all unidirectional (GANs as Two Factors §3):

factoris
NoiseSource — the latent prior, emitting a SampleBelief
GeneratorFactor — the pushforward
RatioFactor — the comparison

The division of labour is exactly §2’s thesis made structural: the generator carries no energy at all (energy returns 0.0; a function has no residual, so every pair satisfies it), and all the learning signal lives on the comparison factor. That zero is not a stub — it is the statement of the problem.

5. Why this matters beyond GANs

Here is the connection that makes the paper worth a note in this vault rather than a citation.

The original sample-pooling gap in messages has a solution when one operand is a likelihood potential. Importance reweighting needs a ratio:

RatioFactor emits LogPotentialBelief for , independent of the cavity. Mycelium.combine applies it to particles; AdversarialFactors.reweight and lens invert provide explicit posterior reweighting. The Gaussian oracle in test/runtests.jl checks reweighted moments, and test/conformance.jl checks a particle prior with two ratio factors on one variable against weights proportional to .

Mycelium warns on severe ESS collapse; explicit reweight callers can inspect effective_sample_size. Applying the same ratio twice squares it, which is the product of repeated evidence. The older version of this note incorrectly inferred failure of associativity and commutativity from lack of idempotence. Two particle clouds still cannot be pooled without a density or potential supplied by one side.

6. What it costs

The energy becomes an estimate. Every other factor in this project computes its energy; this one fits it, so the energy carries estimation error of unknown sign and magnitude. Inversions and Bayesian Lenses licenses inexact inversions — “the quality of the choice is what the free energy measures” — but this is an inexact energy, and the free energy has no term for it because the free energy is the thing being estimated. ratio §5.

And the comparison is adversarial. Fitting is itself a learning problem played against the generator, which is where GANs as Two Factors §4’s sign obstruction comes in.

Sources

  • Mohamed & Lakshminarayanan, Learning in Implicit Generative Models, arXiv:1610.03483 — the definition, the four estimators, the likelihood-free-inference connection.
  • Goodfellow et al., Generative AdversarialFactors Nets, NeurIPS 2014 — the original, and the optimal-discriminator computation §3 rests on.
  • Nowozin, Cseke & Tomioka, f-GAN, NeurIPS 2016 — the divergence-minimisation column.
  • Sugiyama, Suzuki & Kanamori, Density Ratio Estimation in Machine Learning, 2012 — the statistics this predates GANs by.
  • Tran, Ranganath & Blei, Hierarchical Implicit Models and Likelihood-Free Variational Inference, NeurIPS 2017 — ratio estimation used for inference rather than generation, which is the reading §5 needs.

Related: GANs as Two Factors, Three Senses of Implicit, AdversarialFactors, generator, ratio, messages, Implicit Learners, Inversions and Bayesian Lenses