7 분 소요

1. 원문 링크

2. 관련 코드

3. 논문 리뷰

Abstract

  • 우리는 적대적 프로세스를 통해 생성 모델을 추정하는 새로운 프레임워크(모델 G, D)를 제안함.
  • 모델 G에 대한 훈련 절차는 D가 실수할 확률을 최대화하는 것.
    • 원문 : We propose a new framework for estimating generative models via an adversarial process, in which we simultaneously train two models: a generative model G that captures the data distribution, and a discriminative model D that estimates the probability that a sample came from the training data rather than G.

Introduction

  • 딥 생성 모델은 최대 우도 추정 및 관련 전략에서 발생하는 많은 난해한 확률적 계산을 근사화하는 어려움과 생성 맥락에서 조각별 선형 유닛의 이점을 활용하는 어려움으로 인해 영향을 덜 미쳤다. 우리는 이러한 어려움을 피할 수 있는 새로운 생성 모델 추정 절차를 제안한다.
    • 원문 : Deep generative models have had less of an impact, due to the difficulty of approximating many intractable probabilistic computations that arise in maximum likelihood estimation and related strategies, and due to difficulty of leveraging the benefits of piecewise linear units in the generative context. We propose a new generative model estimation procedure that sidesteps these difficulties.
  • 생성 모델이 다층 퍼셉트론을 통해 무작위 노이즈를 전달하여 샘플을 생성하고, 판별 모델도 다층 퍼셉트론인 특수한 경우를 탐구한다. 우리는 이 특수한 경우를 적대적 네트라고 부른다. 이 경우, 우리는 역전파와 드롭아웃 알고리즘만을 사용하여 두 모델을 모두 훈련시킬 수 있으며, 순방향 전파만으로 생성 모델에서 샘플을 생성할 수 있다.
    • 원문 : the generative model generates samples by passing random noise through a multilayer perceptron, and the discriminative model is also a multilayer perceptron. We refer to this special case as adversarial nets. In this case, we can train both models using only the highly successful backpropagation and dropout algorithms [17] and sample from the generative model using only forward propagation
  • 잠재 변수를 가진 방향성 그래프 모델의 대안으로는 제한된 볼츠만 머신(RBMs), 심층 볼츠만 머신(DBMs) 및 그 다양한 변형과 같은 비방향성 그래프 모델이 있다
    • 원문 : An alternative to directed graphical models with latent variables are undirected graphical models with latent variables, such as restricted Boltzmann machines (RBMs) [27, 16], deep Boltzmann machines (DBMs) [26] and their numerous variants.
  • 심층 신뢰 신경망(DBNs)은 단일 비방향성 계층과 여러 방향성 계층을 포함하는 하이브리드 모델이다.
    • 원문 : Deep belief networks (DBNs) are hybrid models containing a single undirected layer and several directed layers.
  • NCE에서는 이 연구와 마찬가지로 판별 훈련 기준을 사용하여 생성 모델을 맞춘다.
    • 원문 : In NCE, as in this work, a discriminative training criterion is employed to fit a generative model.
  • 이 분야의 최근 주요 연구에는 일반화된 잡음 제거 오토인코더를 확장한 생성적 확률 네트워크(GSN) 프레임워크가 포함된다.
    • 원문 : Prominent recent work in this area includes the generative stochastic network (GSN) framework, which extends generalized denoising auto-encoders.
  • GSNs와 비교할 때, 적대적 신경망 프레임워크는 샘플링을 위해 마르코프 체인을 필요로 하지 않는다.
    • 원문 : Compared to GSNs, the adversarial nets framework does not require a Markov chain for sampling.

Adversarial nets

  • 우리는 D가 훈련 예제와 G로부터 생성된 샘플에 올바른 레이블을 할당할 확률을 최대화하도록 훈련합니다. 동시에, G는 $\log{(1-D(G(z)))}$ 를 최소화하도록 훈련합니다. 다시 말해, D와 G는 다음과 같은 가치 함수 $V(G,D)$ 를 가진 2인 미니맥스 게임을 플레이합니다.
    • 원문 : We train D to maximize the probability of assigning the correct label to both training examples and samples from G. We simultaneously train G to minimize log(1 − D(G(z))): In other words,D and G play the following two-player minimax game with value function V(G,D):
$$\min_{G} \max_{D} V(D,G) = \mathbb{E}_{x \sim p_{data}(x)} \left[\log D(x) \right] + \mathbb{E}_{z\sim p_{z}(z)} \left[\log(1-D(G(z))) \right]$$
  • 실제로 위 식이 모델G에게 충분한 기울기(그래디언트)를 제공하지 못할수도 있습니다. 학습 초기의 모델G는 성능이 낮아, 학습 데이터와 명확히 달라 모델D가 쉽게 거부할 수 있습니다. 이 경우, $\log{(1-D(G(z)))}$가 포화됩니다. $\log{(1-D(G(z)))}$ 를 최소화하도록 G를 훈련하는 대신, $\log{D(G(z))}$ 를 최대화하도록 G를 훈련할 수 있습니다.
    • 원문 : 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 train in g data. In this case, $\log{(1−D(G(z)))}$ saturates. Rather than training G to minimize $log(1−D(G(z)))$ we can train G to maximize $logD(G(z))$.This objective function results in the same fixed point of the dynamics of G and D but provides much stronger gradients early in learning. image.png

Theoretical Results

학습 : 가중치 업데이트 ~ Adam

m = minibatch size
$\theta$ 는 Loss function

  • 모델D 업데이트 : Update the discriminator by ascending its stochastic gradient:
  • 모델D는 D(x)는 1, D(G(z))는 0이길 바람(판별하길 바람)
$$+\nabla_{\theta_d} \frac{1}{m} \sum_{i=1}^{m} \left[ \log D(x^{(i)}) + \log (1 - D(G(z^{(i)}))) \right]$$
  • 모델G 업데이트 : Update the generator by descending its stochastic gradent:
  • 모델G는 D(G(z))가 1이길 바람(속이길 바람)
$$-\nabla_{\theta_g} \frac{1}{m} \sum_{i=1}^{m} \log \left( 1 - D \left( G \left( z^{(i)} \right) \right) \right)$$

Global Optimality of $p_{g} = p_{data}$

D를 최대화 하기 위한 식
$$D^{*}_{G}(x) = \frac{P_{data}(x)}{P_{data}(x)+P_{g}(x)}$$
  • 증명
    • Proof. The training criterion for the discriminator D, given any generator G, is to maximize the quantity V(G,D)
    • 알아야 하는 점
      • $P_{z}(z) = P_{g}(x)$,
      • $function\ y → alog(y) + blog(1-y)\ achives\ its\ maximum\ in\ \left[0,1\right]\ at\ \frac{a} {a+b}$
$$V(G,D) = \int_{x}{P_{data}(x)log(D(x))dx} + \int_{z}{P_{z}(z)log(1-D(g(z)))dz}$$
$$= \int_{x}{P_{data}(x)log(D(x))+P_{g}(x)log(1-D(x))dx} $$
G를 $p_{g} = p_{data}$로 만들기
  • the training objective for D can be interpreted as maximizing the log-likelihood for estimating the conditional probability $P(Y=y|x)$ where $Y$ indicates whether $x$ comes from $P_{data} (with \ y = 1)$ or from $P_{g} (with \ y = 0)$
$$D^*_{G}(x) = D^*_{G}(G(z))$$

$$C(G) = \max_{D}V(G,D)$$
$$= \mathbb{E}_{x \sim p_{data}} \left[ \log D^*_G(x) \right] + \mathbb{E}_{z \sim p_z} \left[ \log (1 - D^*_G(G(z))) \right]$$
$$= \mathbb{E}_{x \sim p_{data}} \left[ \log D^*_G(x) \right] + \mathbb{E}_{x \sim p_{g}} \left[ \log \left(1 - D^*_G(x) \right) \right]$$
$$= \mathbb{E}_{x \sim p_{data}} \left[ \log \frac{p_{data}(x)}{p_{data}(x) + p_g(x)} \right] + \mathbb{E}_{x \sim p_g} \left[ \log \frac{p_g(x)}{p_{data}(x) + p_g(x)} \right]$$
  • Theorem 1. $C(G)$ achives the value $-log4$
    • 증명
$$D^{*}_{G}(x) = \frac{P_{data}(x)}{P_{data}(x)+P_{g}(x)}$$
$$KL(P_{data}\||P_{g}) = \int_{-\infty}^{\infty} p_{data}(x) \log \left( \frac{p_{data}(x)}{p_{g}(x)} \right) dx$$

$$C(G) = \max_D V(G, D) = \mathbb{E}_{x \sim p_{data}(x)} [\log D^{*}(x)] + \mathbb{E}_{z \sim p_z(z)} [\log(1 - D^{*}(G(z)))]$$
$$= \mathbb{E}_{x \sim p_{data}(x)} \left[ \log \frac{p_{data}(x)}{p_{data}(x) + p_g(x)} \right] + \mathbb{E}_{x \sim p_g(x)} \left[ \log \frac{p_g(x)}{p_{data}(x) + p_g(x)} \right]$$
$$= \mathbb{E}_{x \sim p_{data}(x)} \left[ \log \frac{2 * p_{data}(x)}{p_{data}(x) + p_g(x)} \right] + \mathbb{E}_{x \sim p_g(x)} \left[ \log \frac{2 * p_g(x)}{p_{data}(x) + p_g(x)} \right]-log(4)$$
$$=KL(p_{data}||\frac{p_{data}(x)+p_{g}(x)}{2}) + KL(p_{g}||\frac{p_{data}(x)+p_{g}(x)}{2})-log(4)$$
$$=2*JSD(p_{data}||p_{g})-log(4)$$
  • 이때 $JSD(p_{data}||p_{g})$는 $p_{data} = p_{g}$일때 0이라 $C(G)$는 최소값 -$log(4)$에서 최적점을 가짐
Convergence of Algorithm 1
$$\mathbb{E}_{x \sim p_{data}}[\log D^*_G(x)] + \mathbb{E}_{x \sim p_g}[\log(1 - D^*_G(x))]$$
  • G, D 성능이 충분히 좋고, 위의 기준에 의거 업데이트가 된다면 $P_{g}$는 $P_{data}$로 수렴한다.

  • 증명

    • $V(G, D) = U(p_{g}, D)$ 재 정의(G는 z를 인자를 받아 x라는 변수를 뱉음 ~ 이때 확률 분포는 $p_{g}$를 뱉으니 정의 가능)
    • $U(p_{g},D)$ 함수를 $p_{g}$로 미분 시 $log(1-D(x))$로 결국 도함수 결과가 상수($D(x)$와 $P_{g}$는 관계가 없기 때문)
      • 이는 $p_{g}$ 가 $U(p_{g},D)$에 대해 “선형성”을 가짐을 의미 → vanishing gradient 문제가 발생할 수 없어, 적은 학습량에도 빠르게 $p_g$가 $p_x$로 수렴함을 뜻함

Experiments

  • 훈련 데이터셋 : MNIST, TFD(Toronto Face Database), CIFAR-10
  • 생성자는 Relu, sigmoid 활성화 함수 조합
  • 판별자 : maxout 활성화 함, Dropout 적용
    • 원문 : Wetrained adversarial nets an a range of datasets including MNIST[23], the Toronto Face Database (TFD) [28], and CIFAR-10 [21]. The generator nets used a mixture of rectifier linear activations [19, 9] and sigmoid activations, while the discriminator net used maxout [10] activations. The generator nets used a mixture of rectifier linear activations [19, 9] and sigmoid activations, while the discriminator net used maxout [10] activations.
  • 성능비교
    • Gaussian Parzen window기준 : 제일 높은 것을 확인 가능 image.png

Advantages and disadvantages

  • 단점 : $p_{g}(x)$가 명백할 수 없고 D, G 모델이 학습 중에 잘 동기화 되어야 함
    • 원문 : The disadvantages are primarily that there is no explicit representation of $p_{g}(x)$, and that D must be synchronized well with G during training
  • 장점 : Markov chain이 절대 필요치 않고 학습 중 추론 과정이 필요없다.
    • 원문 : The advantages are that Markov chains are never needed, only backprop is used to obtain gradients, no inference is needed during learning, and a wide variety of functions can be incorporated into the model
  • 주된 장점 : 생성자가 데이터에 의해 바로 업데이트 되지 않는 것, 형태가 기존 Markov chain에 비해 sharp하다는 점.
    • 원문 : Adversarial models may also gain some statistical advantage from the generator network not being updated directly with data examples, but only with gradients flowing through the discriminator. This means that components of the input are not copied directly into the generator’s parameters. Another advantage of adversarial networks is that they can represent very sharp, even degenerate distributions, while methods based on Markov chains require that the distribution be somewhat blurry in order for the chains to be able to mix between modes.

댓글남기기