diff --git a/_posts/2018-05-28-InfoGAN.markdown b/_posts/2018-05-28-InfoGAN.markdown index b44add6..420d5bf 100644 --- a/_posts/2018-05-28-InfoGAN.markdown +++ b/_posts/2018-05-28-InfoGAN.markdown @@ -63,7 +63,37 @@ observing each variable separately. **Questions**: 1. From PRML: 1.31, 1.36, 1.37, 1.38, 1.39, 1.41. +
Solution +

+ PRML 1.31: Consider two variables \(x\) and \(y\) having joint distribution \(p(x,y)\). Show that the differential entropy of this pair of variables satisfies \(H(x,y) \le H(x) + H(y)\) with equality if, and only if, \(x\) and \(y\) are statistically independent. +

+ If \(p(x)\) and \(p(y)\) are independent then the joint distribution is given by:
+ \(p(x,y) = p(x)p(y)\) +

+ Based on the independent \(p(x)\) and \(p(y)\) the joint entropy can be derived from the conditional entropies \(H(x|y)\) and \(H(y|x)\):
+ \(H(x|y) = H(x)\)
+ \(H(y|x) = H(y) \to\)
+ \(H(x,y) = H(x) + H(y|x) = H(y) + H(x|y) \to\)
+ \(H(x,y) = H(x) + H(y)\) +

+ Therefore, there is no mutual information \(I(x,y)\) if \(p(x)\) and \(p(y)\) are independent:
+ \(H(x,y) = H(x) + H(y)\ \to\)
+ \(I(x,y) = H(x) + H(y) - H(x,y) = H(x,y) - H(x,y) = 0\) +

+ If \(p(x)\) and \(p(y)\) are dependent:
+ \(H(x,y) < H(x) + H(y)\ \to\)
+ \(I(x,y) = H(x) + H(y) - H(x,y) > 0\) +

+ The indepent and dependent case can be combined to a general form:
+ \(H(x,y) \le H(x) + H(y)\ \to\)
+ \(I(x,y) = H(x) + H(y) - H(x,y) \ge 0\) +

+
2. How is Mutual Information similar to correlation? How are they different? Are they directly related under some conditions? +
Solution +

Start here. +

+
3. In classification problems, [minimizing cross-entropy loss is the same as minimizing the KL divergence of the predicted class distribution from the true class distribution](https://ai.stackexchange.com/questions/3065/why-has-cross-entropy-become-the-classification-standard-loss-function-and-not-k/4185). Why do we minimize the KL, rather than other measures, such as L2 distance? @@ -114,6 +144,9 @@ observing each variable separately. **Required Reading**: 1. [JS Divergence](https://en.wikipedia.org/wiki/Jensen%E2%80%93Shannon_divergence) 2. [The original GAN paper](https://arxiv.org/abs/1406.2661) + + **Optional Reading**: + 1. [NIPS 2016 Tutorial: Generative Adversarial Networks](https://arxiv.org/abs/1701.00160) **Questions**: 1. Prove that $$0 \leq JSD(P||Q) \leq 1$$ bit for all P, Q. When are the bounds achieved? @@ -122,6 +155,21 @@ observing each variable separately.

2. What are the bounds for KL divergence? When are those bounds achieved? +
Solution +

Start here. +

+ The Kullback–Leibler divergence \(D_{KL}(P||Q)\) between \(P\) and \(Q\) is defined as:
+ \(D_{KL}(P||Q) =  \sum_{x}P(x) \log_2\left(\frac{P(x)}{Q(x)}\right)\) + 

+ The lower bound is reached when \(P(x) = Q(x)\) because \(\left(\frac{P(x)}{Q(x)}\right) = 1\):
+ \(D_{KL}(P||Q) = \sum_{x}P(x) \log_2(1) = \sum_{x}P(x) 0 = 0\) + 

+ The upper bound is reached when \(Q(x)\) is disjoint from \(P(x)\), i.e., \(Q(x)\) is zero where \(P(x)\) is not zero, because then the log-ratio \(\log_2\left(\frac{P(x)}{Q(x)}\right)\) becomes \(\infty\):
+ \(x_i \in x\)
+ \(P(x_i) \log_2\left(\frac{P(x_i)}{Q(x_i)}\right) = P(x_i) \log_2\left(\frac{P(x_i)}{0}\right) = \infty \to\)
+ \(D_{KL}(P||Q) =  \sum_{x}P(x) \log_2\left(\frac{P(x)}{Q(x)}\right) = \infty\) +

+
3. In the paper, why do they say “In practice, equation 1 may not provide sufficient gradient for G to learn well. Early in learning, when G is poor, D can reject samples with high confidence because they are clearly different from the training data. In this case, $$log(1 − D(G(z)))$$ saturates”?
Solution

Understanding the vanishing generator gradients point in the GAN paper