# # 凸共轭和GAN有什么关系?

$f^{*}(t)=\max _{x \in dom(f)}\{x t-f(x)\}$

$f(x) = \max _{t \in dom(f^*)}\{x t-f^*(x)\}$

$D_{f}(P \| Q)=\int_{x} q(x) f\left(\frac{p(x)}{q(x)}\right) d x$

$\frac{p(x)}{q(x)}$作为一个整体，带入到第二个式子，可以得到:

$D_{f}(P \| Q)=\int_{x} q(x) f\left(\frac{p(x)}{q(x)}\right) d x$

$= \int_{x} q(x) \left(\max_{t \in dom(f^*)}\{ \frac{p(x)}{q(x)} t-f^*(t) \} \right) d x$

$D_{f}(P \| Q) \geq \int_{x} q(x) \left( \frac{p(x)}{q(x)}D(x) - f^*(D(x)) \right) dx$

$= \int_{x} p(x)D(x) - q(x)f^*(D(x)) dx$

$\frac{p(x)}{q(x)}D(x) - f^*(D(x))$

$\max_{t \in dom(f^*)}\{ \frac{p(x)}{q(x)} t-f^*(t) \}$

$D_{f}(P \| Q) \approx \max _{D} \left\{\int_{x} p(x) D(x) d x-\int_{x} q(x) f^{*}(D(x)) dx \right\}$

$=\max _{D}\left\{\mathbb{E}_{x \sim P}[D(x)]-\mathbb{E}_{x \sim Q}\left[f^{*}(D(x))\right]\right\}$

$D_{f}(P_{data} \| P_{G}) \approx \max _{D}\left\{\mathbb{E}_{x \sim P_{data}}[D(x)]-\mathbb{E}_{x \sim P_{G}}\left[f^{*}(D(x))\right]\right\}$

## # 和GAN的关系

GAN的最终目的:

$G^{*}=\arg \min _{G} D_{f}\left(P_{\text {data}} \| P_{G}\right)$

$=\arg \min _{G} \max _{D}\left\{\mathbb{E}_{x \sim P_{\text {data}}}[D(x)]-\mathbb{E}_{x \sim P_{G}}\left[f^{*}(D(x))\right]\right\}$

$=\arg \min _{G} \max _{D} V(G, D)$

$V(G, D) = \mathbb{E}_{x \sim P_{\text {data}}}[\log D(x)]+\mathbb{E}_{x \sim P_{G}}[\log (1-D(x))]$

$V(G, D) = \mathbb{E}_{x \sim P_{\text {data}}}[D(x)]-\mathbb{E}_{x \sim P_{G}}\left[f^{*}(D(x))\right]$

$D_{f}\left(P_{\text {data }} \| P_{G}\right)$

$f$取不同的值可以量不同的Deivergence.