논문 구현

참고 영상

1. Introduction

본 논문에서 제안하는 모델인 Generative Adversarial Net, GAN은 경찰과 위조지폐범 사이의 게임에 비유할 수 있다. 위조지폐범은 최대한 진짜 같은 화폐를 만들어(생성) 경찰을 속이기 위해 노력하고, 경찰은 진짜 화폐와 가짜 화폐를 완벽히 판별(분류)하여 위조지폐범을 검거하는 것을 목표로 한다. 이러한 경쟁적인 학습이 지속되다 보면 어느 순간 위조지폐범은 진짜와 다를 바 없는 위조지폐를 만들 수 있게 되고 경찰이 위조지폐를 구별할 수 있는 확률도 가장 헷갈리는 50%로 수렴하게 되어 경찰은 위조지폐와 실제 화폐를 구분할 수 없는 상태에 이르게 되는 것이다.

Untitled

이 framework는 다양한 종류의 모델과 최적화 알고리즘을 위한 구체적인 훈련 알고리즘을 도출할 수 있다. 이 논문에서는 generative model이 MLP를 통해 random noise를 생성하고 discriminative model도 MLP인 경우에 대해 조사했는데, 이러한 케이스를 adversarial net이라고 한다. 이 경우 backpropagation과 dropout algorithm만을 사용하여 두 모델을 훈련할 수 있으며, generative model에서는 forward propagation만을 사용하여 샘플링할 수 있다.

2. Related Works

이 section에서는 본 연구와 관련된 다른 연구에 대해 소개하고 있다.

3. Adversarial nets

Adversarial modeling framework는 generator와 discriminator model이 모두 multilayer perceptron인 경우에 가장 잘 적용된다. Data $\mathbf x$에 대한 generator의 분포 $p_g$를 학습하기 위해 input noise variable $p_z(\mathbf z)$를 정의할 때, 다음의 두 모델을 정의할 수 있다.

이때 discriminator의 output은 single scalar로, $D(\mathbf x)$는 $\mathbf x$가 real distribution으로부터 왔을 확률을 나타낸다. 이렇게 정의한 두 모델은 다음의 식을 이용하여 학습된다.

Untitled

$V(G,D)$는 value function으로, $G$는 이 값을 감소시키고 $D$는 이 값을 증가시키는 방향으로 학습된다. $D$와 $G$는 value function을 가지고 적대적인 two-player minimax game을 진행하는 것으로 볼 수 있는데, 그렇기 때문에 이 모델의 이름이 generative adversarianl net인 것이다.

이 과정을 도식화한 것이 바로 아래의 Figure 1이다. 이때 검정색 점선은 원본 데이터의 확률분포 $p_{data}(\mathbf x)$, 초록색 실선은 생성 모델로 만들어진 데이터의 확률분포 $p_g(\mathbf x)$, 파란색 점선은 판별 모델의 확률값 $D(\mathbf x)$를 뜻하며, 아래의 $\mathbf z$에서 $\mathbf x$로 향하는 화살표는 $\mathbf x=G(\mathbf z)$의 대응을 의미한다. 후술하겠지만, 이때 $D(\mathbf x)=\frac{p_{data}(\mathbf x)}{p_{data}(\mathbf x)+p_g(\mathbf x)}$로 수렴한다. 그림을 보면 과정이 반복될수록 $G$를 학습시켜 초록 실선이 검정 점선에 가까워지는 것을 확인할 수 있다. 최종 목표는 $p_g = p_{data}$가 되도록 만들어 판별 모델이 두 분포를 비교하지 못하도록 하는 것, 즉 $D(\mathbf x)=\frac{1}{2}$가 되도록 하는 것이다.

Figure 1: Generative adversarial nets are trained by simultaneously updating the discriminative distribution ($D$, blue, dashed line) so that it discriminates between samples from the data generating distribution (black, dotted line) $p_x$ from those of the generative distribution $p_g$ ($G$, green, solid line).

Figure 1: Generative adversarial nets are trained by simultaneously updating the discriminative distribution ($D$, blue, dashed line) so that it discriminates between samples from the data generating distribution (black, dotted line) $p_x$ from those of the generative distribution $p_g$ ($G$, green, solid line).