SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
GAN
(Generative Adversarial Network)
Jihoo Kim
2004~2009, Stanford University (B.S. M.S. in Computer Science)
2010~2014, Université de Montréal (Ph.D. in Machine Learning )
2015~2016, Google Brain (Research Scientist)
2016~2017, OpenAI Institute
2017~2019, Google Brain (Research Scientist)
2019.03~ Apple Inc. (Director of Machine Learning)
Advances in Neural Information Processing Systems 27 (NIPS 2014)
Generative Adversarial Nets (Ian Goodfellow)
Ian Goodfellow
1985년생
GAN 저자
GAN 개념
<Unsupervised Learning의 대표 주자 GAN>
단순히 Supervised Learning에 의해 분류만 하는 것이 아니라,
정답 없이 새로운 것을 지속적으로 생성해낼 수 있는 능력을 가진다는 것
은 그 데이터를 완전히 이해하고 있다는 의미로서,
생성하는 능력을 가지게 되면 분류하는 것도 자동적으로 쉽게 할 수 있음
(= 어려운 수학 문제를 다른 사람에게 설명을 잘 할 수 있다면,
그 문제를 푸는 일은 식은 죽 먹기)
“What I cannot create, I do not understand”
- 노벨 물리학상을 받은 미국의 물리학자 Richard Feynman
GAN 개념
<GAN을 경찰과 위조지폐범에 비유>
처음 GAN을 제안한 Ian Goodfellow는
GAN을 경찰과 위조지폐범 사이의 게임에 비유함
위조지폐범은 최대한 진짜 같은 화폐를 만들어(생성)
경찰을 속이기 위해 노력함
경찰은 진짜 화폐와 가짜 화폐를 완벽히 판별(분류)하여
위조지폐범을 검거하는 것을 목표로 함
이러한 경쟁적인 학습이 지속되면 위조지폐범은 점점 더 진짜같은
위조지폐를 만들 수 있게 되고, 어느 순간 경찰이 위조지폐를 구별할
확률이 50%로 수렴하여 실제와 구분할 수 없게 됨
<분류모델의 학습>
1단계: 진짜 데이터를 입력해서 네트워크가 해당 데이터를 진짜로 분류하도록 학습시키는 과정
2단계: 생성 모델에서 생성한 가짜 데이터를 입력해서 해당 데이터를 가짜로 분류하도록 학습시키는 과정
<생성모델의 학습>
분류모델을 학습시킨 다음에 학습된 분류모델을 속이는 방향으로 생성모델을 학습시켜줘야 함
이와 같은 학습과정을 반복하면, 생성모델을 분류에 성공할 확률을 낮추려 하고,
분류모델은 분류에 성공할 확률을 높이려 하면서 서로가 서로를 경쟁적으로 발전시키는 구조
GAN 학습
GAN 학습
보다 구체적으로, GAN은 아래와 같은 목적함수 V(D,G)를 이용하여,
아래 수식처럼 minimax problem을 푸는 방식으로 학습
D: Discriminator
G: Generator
V(D,G): Value Function
실제 데이터에 대한 확률분포에서 샘플링한 데이터 x
(= Sample x from Real Data Distribution)
가우시안분포를 사용하는 임의의 노이즈에서 샘플링한 데이터 z
(= Sample z from Gaussian Distribution)
D(x): Discriminator가 x를 real data라고 판별할 확률 (0~1 사이의 값)
x가 real data라고 판별하면, D(x)=1
x가 fake data라고 판별하면, D(x)=0
D(G(z)): Generator가 만든 fake data G(z)를 real data라고 판별할 확률 (0~1 사이의 값)
G(z)가 real data라고 판별하면, D(G(z))=1
G(z)가 fake data라고 판별하면, D(G(z))=0
최대가 되어야 함
D(x) = 1이 되어야 함
진짜 데이터를 진짜로 분류하도록 학습 (1단계)
최대가 되어야 함
1-D(G(z)) = 1이 되어야 함, D(G(z)) = 0
가짜 데이터를 가짜로 분류하도록 학습 (2단계)
<분류모델(D)의 학습>
1단계: 진짜 데이터를 입력해서 네트워크가 해당 데이터를 진짜로 분류하도록 학습시키는 과정
2단계: 생성 모델에서 생성한 가짜 데이터를 입력해서 해당 데이터를 가짜로 분류하도록 학습시키는 과정
GAN 학습
Discriminator 관점
log(x)
<생성모델(G)의 학습>
분류모델을 학습시킨 다음에 학습된 분류모델을 속이는 방향으로 생성모델을 학습시켜줘야 함
최소가 되어야 함
1-D(G(z)) = 0이 되어야 함, D(G(z)) = 1
분류모델(D)을 속이는 방향으로 학습
Generator 관점
GAN 학습
GAN 학습
Data Generating
Distribution(pdata)
(= Real Data)
Generative
Distribution(pg)
(= Fake Data)
Discriminative
Distribution(D)
x=G(z) mapping을 통해
만들어진 가짜 데이터 분포(pg)
D*(x)= 을 통해
판별 확률 분포(D) 업데이트
가짜 데이터 분포(pg)를
진짜 데이터 분포(pdata)에
가깝도록 업데이트
학습을 계속 반복하면,
가짜(pg)= 진짜(pdata)
두 분포를 구분할 수 없을
정도로 되어 D(x) = 1/2
D(x) = 1/2
<GAN이 잘 작동하는 이유>
실제로 진짜 데이터 분포(pdata)와 가짜 데이터 분포(pg), 두 분포 사이의 거리를 줄이는 방향으로 학습하기 때문
GAN 원리
KL(p ||q) =
• 두 분포가 얼마나 비슷하게 생겼는지를 알기 위한 척도
• 원본 데이터가 가지고 있는 정보량을 잘 보존할 수록 원본 데이터와 비슷한 분포
• 원본 확률 분포 p와 근사된 분포 q에 대하여 i번째 item이 가진 정보량의 차이(정보 손실량)의 기댓값
• KL-Divergence는 Symmetric하지 않음, KL(p ||q) ≠ KL(q ||p)
• 두 확률 분포 사이의 distance로서의 역할을 하기 위해 KL-Divergence를 Symmetric하도록 개량, JSD(p ||q) = JSD(q ||p)
Kullback-Leibler(KL) Divergence
Jensen-Shannon(JS) Divergence
GAN 원리
GAN 증명
GAN 증명
GAN 증명
GAN 증명
GAN 증명
GAN 증명
GAN 증명
GAN 증명
GAN 증명
GAN 증명
GAN 증명
GAN 증명
GAN 증명
References
https://arxiv.org/abs/1406.2661
https://www.samsungsds.com/global/ko/support/insights/Generative-adversarial-network-AI-2.html
https://www.slideshare.net/NaverEngineering/1-gangenerative-adversarial-network
https://hyeongminlee.github.io/post/prob002_kld_jsd/

Mais conteúdo relacionado

Mais procurados

Ai 그까이거
Ai 그까이거Ai 그까이거
Ai 그까이거도형 임
 
Generative Adversarial Networks (GAN)
Generative Adversarial Networks (GAN)Generative Adversarial Networks (GAN)
Generative Adversarial Networks (GAN)Manohar Mukku
 
[기초개념] Recurrent Neural Network (RNN) 소개
[기초개념] Recurrent Neural Network (RNN) 소개[기초개념] Recurrent Neural Network (RNN) 소개
[기초개념] Recurrent Neural Network (RNN) 소개Donghyeon Kim
 
[GomGuard] 뉴런부터 YOLO 까지 - 딥러닝 전반에 대한 이야기
[GomGuard] 뉴런부터 YOLO 까지 - 딥러닝 전반에 대한 이야기[GomGuard] 뉴런부터 YOLO 까지 - 딥러닝 전반에 대한 이야기
[GomGuard] 뉴런부터 YOLO 까지 - 딥러닝 전반에 대한 이야기JungHyun Hong
 
Wasserstein GAN 수학 이해하기 I
Wasserstein GAN 수학 이해하기 IWasserstein GAN 수학 이해하기 I
Wasserstein GAN 수학 이해하기 ISungbin Lim
 
인공신경망
인공신경망인공신경망
인공신경망종열 현
 
딥러닝 - 역사와 이론적 기초
딥러닝 - 역사와 이론적 기초딥러닝 - 역사와 이론적 기초
딥러닝 - 역사와 이론적 기초Hyungsoo Ryoo
 
Generative Adversarial Networks and Their Applications
Generative Adversarial Networks and Their ApplicationsGenerative Adversarial Networks and Their Applications
Generative Adversarial Networks and Their ApplicationsArtifacia
 
Generative adversarial networks
Generative adversarial networksGenerative adversarial networks
Generative adversarial networksYunjey Choi
 
Generative Adversarial Networks
Generative Adversarial NetworksGenerative Adversarial Networks
Generative Adversarial NetworksMark Chang
 
GAN - Theory and Applications
GAN - Theory and ApplicationsGAN - Theory and Applications
GAN - Theory and ApplicationsEmanuele Ghelfi
 
딥러닝 기본 원리의 이해
딥러닝 기본 원리의 이해딥러닝 기본 원리의 이해
딥러닝 기본 원리의 이해Hee Won Park
 
Generative adversarial networks
Generative adversarial networksGenerative adversarial networks
Generative adversarial networks남주 김
 
MobileNet - PR044
MobileNet - PR044MobileNet - PR044
MobileNet - PR044Jinwon Lee
 
Introduction to Generative Adversarial Networks (GANs)
Introduction to Generative Adversarial Networks (GANs)Introduction to Generative Adversarial Networks (GANs)
Introduction to Generative Adversarial Networks (GANs)Appsilon Data Science
 
텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝찬웅 주
 
[PR12] intro. to gans jaejun yoo
[PR12] intro. to gans   jaejun yoo[PR12] intro. to gans   jaejun yoo
[PR12] intro. to gans jaejun yooJaeJun Yoo
 
오토인코더의 모든 것
오토인코더의 모든 것오토인코더의 모든 것
오토인코더의 모든 것NAVER Engineering
 
Variational Inference
Variational InferenceVariational Inference
Variational InferenceTushar Tank
 

Mais procurados (20)

Ai 그까이거
Ai 그까이거Ai 그까이거
Ai 그까이거
 
Generative Adversarial Networks (GAN)
Generative Adversarial Networks (GAN)Generative Adversarial Networks (GAN)
Generative Adversarial Networks (GAN)
 
[기초개념] Recurrent Neural Network (RNN) 소개
[기초개념] Recurrent Neural Network (RNN) 소개[기초개념] Recurrent Neural Network (RNN) 소개
[기초개념] Recurrent Neural Network (RNN) 소개
 
[GomGuard] 뉴런부터 YOLO 까지 - 딥러닝 전반에 대한 이야기
[GomGuard] 뉴런부터 YOLO 까지 - 딥러닝 전반에 대한 이야기[GomGuard] 뉴런부터 YOLO 까지 - 딥러닝 전반에 대한 이야기
[GomGuard] 뉴런부터 YOLO 까지 - 딥러닝 전반에 대한 이야기
 
Wasserstein GAN 수학 이해하기 I
Wasserstein GAN 수학 이해하기 IWasserstein GAN 수학 이해하기 I
Wasserstein GAN 수학 이해하기 I
 
인공신경망
인공신경망인공신경망
인공신경망
 
딥러닝 - 역사와 이론적 기초
딥러닝 - 역사와 이론적 기초딥러닝 - 역사와 이론적 기초
딥러닝 - 역사와 이론적 기초
 
Generative Adversarial Networks and Their Applications
Generative Adversarial Networks and Their ApplicationsGenerative Adversarial Networks and Their Applications
Generative Adversarial Networks and Their Applications
 
Generative adversarial networks
Generative adversarial networksGenerative adversarial networks
Generative adversarial networks
 
Generative Adversarial Networks
Generative Adversarial NetworksGenerative Adversarial Networks
Generative Adversarial Networks
 
GAN - Theory and Applications
GAN - Theory and ApplicationsGAN - Theory and Applications
GAN - Theory and Applications
 
딥러닝 기본 원리의 이해
딥러닝 기본 원리의 이해딥러닝 기본 원리의 이해
딥러닝 기본 원리의 이해
 
Generative adversarial networks
Generative adversarial networksGenerative adversarial networks
Generative adversarial networks
 
MobileNet - PR044
MobileNet - PR044MobileNet - PR044
MobileNet - PR044
 
Introduction to Generative Adversarial Networks (GANs)
Introduction to Generative Adversarial Networks (GANs)Introduction to Generative Adversarial Networks (GANs)
Introduction to Generative Adversarial Networks (GANs)
 
텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝텐서플로우로 배우는 딥러닝
텐서플로우로 배우는 딥러닝
 
[PR12] intro. to gans jaejun yoo
[PR12] intro. to gans   jaejun yoo[PR12] intro. to gans   jaejun yoo
[PR12] intro. to gans jaejun yoo
 
오토인코더의 모든 것
오토인코더의 모든 것오토인코더의 모든 것
오토인코더의 모든 것
 
Variational Inference
Variational InferenceVariational Inference
Variational Inference
 
Uncertainty in Deep Learning
Uncertainty in Deep LearningUncertainty in Deep Learning
Uncertainty in Deep Learning
 

Mais de KyeongUkJang

Photo wake up - 3d character animation from a single photo
Photo wake up - 3d character animation from a single photoPhoto wake up - 3d character animation from a single photo
Photo wake up - 3d character animation from a single photoKyeongUkJang
 
Distilling the knowledge in a neural network
Distilling the knowledge in a neural networkDistilling the knowledge in a neural network
Distilling the knowledge in a neural networkKyeongUkJang
 
Latent Dirichlet Allocation
Latent Dirichlet AllocationLatent Dirichlet Allocation
Latent Dirichlet AllocationKyeongUkJang
 
Gaussian Mixture Model
Gaussian Mixture ModelGaussian Mixture Model
Gaussian Mixture ModelKyeongUkJang
 
CNN for sentence classification
CNN for sentence classificationCNN for sentence classification
CNN for sentence classificationKyeongUkJang
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNEKyeongUkJang
 
Playing atari with deep reinforcement learning
Playing atari with deep reinforcement learningPlaying atari with deep reinforcement learning
Playing atari with deep reinforcement learningKyeongUkJang
 
Chapter 19 Variational Inference
Chapter 19 Variational InferenceChapter 19 Variational Inference
Chapter 19 Variational InferenceKyeongUkJang
 
Natural Language Processing(NLP) - basic 2
Natural Language Processing(NLP) - basic 2Natural Language Processing(NLP) - basic 2
Natural Language Processing(NLP) - basic 2KyeongUkJang
 
Natural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicNatural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicKyeongUkJang
 
Chapter 17 monte carlo methods
Chapter 17 monte carlo methodsChapter 17 monte carlo methods
Chapter 17 monte carlo methodsKyeongUkJang
 
Chapter 16 structured probabilistic models for deep learning - 2
Chapter 16 structured probabilistic models for deep learning - 2Chapter 16 structured probabilistic models for deep learning - 2
Chapter 16 structured probabilistic models for deep learning - 2KyeongUkJang
 
Chapter 16 structured probabilistic models for deep learning - 1
Chapter 16 structured probabilistic models for deep learning - 1Chapter 16 structured probabilistic models for deep learning - 1
Chapter 16 structured probabilistic models for deep learning - 1KyeongUkJang
 
Chapter 15 Representation learning - 2
Chapter 15 Representation learning - 2Chapter 15 Representation learning - 2
Chapter 15 Representation learning - 2KyeongUkJang
 
Chapter 15 Representation learning - 1
Chapter 15 Representation learning - 1Chapter 15 Representation learning - 1
Chapter 15 Representation learning - 1KyeongUkJang
 
Chapter 6 Deep feedforward networks - 2
Chapter 6 Deep feedforward networks - 2Chapter 6 Deep feedforward networks - 2
Chapter 6 Deep feedforward networks - 2KyeongUkJang
 

Mais de KyeongUkJang (20)

Photo wake up - 3d character animation from a single photo
Photo wake up - 3d character animation from a single photoPhoto wake up - 3d character animation from a single photo
Photo wake up - 3d character animation from a single photo
 
YOLO
YOLOYOLO
YOLO
 
AlphagoZero
AlphagoZeroAlphagoZero
AlphagoZero
 
GoogLenet
GoogLenetGoogLenet
GoogLenet
 
Distilling the knowledge in a neural network
Distilling the knowledge in a neural networkDistilling the knowledge in a neural network
Distilling the knowledge in a neural network
 
Latent Dirichlet Allocation
Latent Dirichlet AllocationLatent Dirichlet Allocation
Latent Dirichlet Allocation
 
Gaussian Mixture Model
Gaussian Mixture ModelGaussian Mixture Model
Gaussian Mixture Model
 
CNN for sentence classification
CNN for sentence classificationCNN for sentence classification
CNN for sentence classification
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE
 
Playing atari with deep reinforcement learning
Playing atari with deep reinforcement learningPlaying atari with deep reinforcement learning
Playing atari with deep reinforcement learning
 
Chapter 20 - GAN
Chapter 20 - GANChapter 20 - GAN
Chapter 20 - GAN
 
Chapter 19 Variational Inference
Chapter 19 Variational InferenceChapter 19 Variational Inference
Chapter 19 Variational Inference
 
Natural Language Processing(NLP) - basic 2
Natural Language Processing(NLP) - basic 2Natural Language Processing(NLP) - basic 2
Natural Language Processing(NLP) - basic 2
 
Natural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicNatural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - Basic
 
Chapter 17 monte carlo methods
Chapter 17 monte carlo methodsChapter 17 monte carlo methods
Chapter 17 monte carlo methods
 
Chapter 16 structured probabilistic models for deep learning - 2
Chapter 16 structured probabilistic models for deep learning - 2Chapter 16 structured probabilistic models for deep learning - 2
Chapter 16 structured probabilistic models for deep learning - 2
 
Chapter 16 structured probabilistic models for deep learning - 1
Chapter 16 structured probabilistic models for deep learning - 1Chapter 16 structured probabilistic models for deep learning - 1
Chapter 16 structured probabilistic models for deep learning - 1
 
Chapter 15 Representation learning - 2
Chapter 15 Representation learning - 2Chapter 15 Representation learning - 2
Chapter 15 Representation learning - 2
 
Chapter 15 Representation learning - 1
Chapter 15 Representation learning - 1Chapter 15 Representation learning - 1
Chapter 15 Representation learning - 1
 
Chapter 6 Deep feedforward networks - 2
Chapter 6 Deep feedforward networks - 2Chapter 6 Deep feedforward networks - 2
Chapter 6 Deep feedforward networks - 2
 

Último

Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 

Último (6)

Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 

GAN - Generative Adversarial Nets

  • 2. 2004~2009, Stanford University (B.S. M.S. in Computer Science) 2010~2014, Université de Montréal (Ph.D. in Machine Learning ) 2015~2016, Google Brain (Research Scientist) 2016~2017, OpenAI Institute 2017~2019, Google Brain (Research Scientist) 2019.03~ Apple Inc. (Director of Machine Learning) Advances in Neural Information Processing Systems 27 (NIPS 2014) Generative Adversarial Nets (Ian Goodfellow) Ian Goodfellow 1985년생 GAN 저자
  • 3. GAN 개념 <Unsupervised Learning의 대표 주자 GAN> 단순히 Supervised Learning에 의해 분류만 하는 것이 아니라, 정답 없이 새로운 것을 지속적으로 생성해낼 수 있는 능력을 가진다는 것 은 그 데이터를 완전히 이해하고 있다는 의미로서, 생성하는 능력을 가지게 되면 분류하는 것도 자동적으로 쉽게 할 수 있음 (= 어려운 수학 문제를 다른 사람에게 설명을 잘 할 수 있다면, 그 문제를 푸는 일은 식은 죽 먹기) “What I cannot create, I do not understand” - 노벨 물리학상을 받은 미국의 물리학자 Richard Feynman
  • 4. GAN 개념 <GAN을 경찰과 위조지폐범에 비유> 처음 GAN을 제안한 Ian Goodfellow는 GAN을 경찰과 위조지폐범 사이의 게임에 비유함 위조지폐범은 최대한 진짜 같은 화폐를 만들어(생성) 경찰을 속이기 위해 노력함 경찰은 진짜 화폐와 가짜 화폐를 완벽히 판별(분류)하여 위조지폐범을 검거하는 것을 목표로 함 이러한 경쟁적인 학습이 지속되면 위조지폐범은 점점 더 진짜같은 위조지폐를 만들 수 있게 되고, 어느 순간 경찰이 위조지폐를 구별할 확률이 50%로 수렴하여 실제와 구분할 수 없게 됨
  • 5. <분류모델의 학습> 1단계: 진짜 데이터를 입력해서 네트워크가 해당 데이터를 진짜로 분류하도록 학습시키는 과정 2단계: 생성 모델에서 생성한 가짜 데이터를 입력해서 해당 데이터를 가짜로 분류하도록 학습시키는 과정 <생성모델의 학습> 분류모델을 학습시킨 다음에 학습된 분류모델을 속이는 방향으로 생성모델을 학습시켜줘야 함 이와 같은 학습과정을 반복하면, 생성모델을 분류에 성공할 확률을 낮추려 하고, 분류모델은 분류에 성공할 확률을 높이려 하면서 서로가 서로를 경쟁적으로 발전시키는 구조 GAN 학습
  • 6. GAN 학습 보다 구체적으로, GAN은 아래와 같은 목적함수 V(D,G)를 이용하여, 아래 수식처럼 minimax problem을 푸는 방식으로 학습 D: Discriminator G: Generator V(D,G): Value Function 실제 데이터에 대한 확률분포에서 샘플링한 데이터 x (= Sample x from Real Data Distribution) 가우시안분포를 사용하는 임의의 노이즈에서 샘플링한 데이터 z (= Sample z from Gaussian Distribution) D(x): Discriminator가 x를 real data라고 판별할 확률 (0~1 사이의 값) x가 real data라고 판별하면, D(x)=1 x가 fake data라고 판별하면, D(x)=0 D(G(z)): Generator가 만든 fake data G(z)를 real data라고 판별할 확률 (0~1 사이의 값) G(z)가 real data라고 판별하면, D(G(z))=1 G(z)가 fake data라고 판별하면, D(G(z))=0
  • 7. 최대가 되어야 함 D(x) = 1이 되어야 함 진짜 데이터를 진짜로 분류하도록 학습 (1단계) 최대가 되어야 함 1-D(G(z)) = 1이 되어야 함, D(G(z)) = 0 가짜 데이터를 가짜로 분류하도록 학습 (2단계) <분류모델(D)의 학습> 1단계: 진짜 데이터를 입력해서 네트워크가 해당 데이터를 진짜로 분류하도록 학습시키는 과정 2단계: 생성 모델에서 생성한 가짜 데이터를 입력해서 해당 데이터를 가짜로 분류하도록 학습시키는 과정 GAN 학습 Discriminator 관점 log(x)
  • 8. <생성모델(G)의 학습> 분류모델을 학습시킨 다음에 학습된 분류모델을 속이는 방향으로 생성모델을 학습시켜줘야 함 최소가 되어야 함 1-D(G(z)) = 0이 되어야 함, D(G(z)) = 1 분류모델(D)을 속이는 방향으로 학습 Generator 관점 GAN 학습
  • 9. GAN 학습 Data Generating Distribution(pdata) (= Real Data) Generative Distribution(pg) (= Fake Data) Discriminative Distribution(D) x=G(z) mapping을 통해 만들어진 가짜 데이터 분포(pg) D*(x)= 을 통해 판별 확률 분포(D) 업데이트 가짜 데이터 분포(pg)를 진짜 데이터 분포(pdata)에 가깝도록 업데이트 학습을 계속 반복하면, 가짜(pg)= 진짜(pdata) 두 분포를 구분할 수 없을 정도로 되어 D(x) = 1/2 D(x) = 1/2
  • 10. <GAN이 잘 작동하는 이유> 실제로 진짜 데이터 분포(pdata)와 가짜 데이터 분포(pg), 두 분포 사이의 거리를 줄이는 방향으로 학습하기 때문 GAN 원리
  • 11. KL(p ||q) = • 두 분포가 얼마나 비슷하게 생겼는지를 알기 위한 척도 • 원본 데이터가 가지고 있는 정보량을 잘 보존할 수록 원본 데이터와 비슷한 분포 • 원본 확률 분포 p와 근사된 분포 q에 대하여 i번째 item이 가진 정보량의 차이(정보 손실량)의 기댓값 • KL-Divergence는 Symmetric하지 않음, KL(p ||q) ≠ KL(q ||p) • 두 확률 분포 사이의 distance로서의 역할을 하기 위해 KL-Divergence를 Symmetric하도록 개량, JSD(p ||q) = JSD(q ||p) Kullback-Leibler(KL) Divergence Jensen-Shannon(JS) Divergence GAN 원리