SlideShare a Scribd company logo
1 of 18
AlphaGo Zero, How it works?
이정현
AlphaGo Zero는?
• AlphaGo 이후 DeepMind 에서 수정해서 2017년에 배포한 새로운 버전
• 사람의 지식 없이도 스스로 학습 가능해졌음
• 학습시간도 더 짧아지고 모형도 더 단순함
• 먼저 AlphagoZero의 대략적인 구조를 먼저 살펴보고
• MCTS
• AlphagoZero의 NN구조
• 둘이 합친 버전을 보자
Contents
AlphaGo Zero 구조
MCTS에서는 노드를 확장하면서 NN에 데이터를 제공하는 역할을
NN는 해당 state에서 policy와 value를 예측하는 역할을 한다
모델을 전부 학습한 이후에 결론적으로 state를 input으로 넣으면
P (policy)
V (value function)
어떤 행동을 취할지에 대한 확률 값들
state가 얼마나 좋은지를 평가, [-1, 1]의 값
예시 ) V3 = 0.5
예시 ) P3= [0 : 0.1 , 1 : 0.2 , 3 : 0.4 , 4 : 0.1 , 5 : 0.2 ]
AlphaGo Zero 구조
MCTS(Monte Carlo Tree Search)
MCTS는 이전부터 최종적으로 게임을 이기위해서 다
음 수를 예측해 나가는 방법으로 자주 쓰였다
트리형태로 노드를 확장해 나가면서 다음 수를 찾아감
순수한 MCTS 알고리즘
•Selection: 루트 R에서 시작하여 연속적인 자식 노드를 선택해 내려가 마디 L에 이른다.
•Expansion: 노드 L에서 승패를 내지 못하고 게임이 종료되면, 하나 또는 그 이상의 자식 노드를 생성하고 그 중 하
나의 노드 C를 선택한다.
•Simulation: 노드C로부터 무작위의 플레이아웃을 실행한다.
•Backpropagation: 플레이아웃의 결과로 C에서 R까지의 경로에 있는 노드들의 정보를 갱신한다.
max
min
max
AlphagoZero에서의 MCTS
각 node는 board판 state이고 , edge는 다음 move를 나타낸다.
Deep network f 를 통해 s’3의 이길 가능성(value)가 0.9이고 다음 move의 확률들을 알 수 있다
AlphagoZero에서의 MCTS
AlphagoZero에서 MCTS를 진행하면서 업데이트 하는 값은 W, N, Q이다
W : 선택한 V 값들의 합
N : node 방문 횟수
Q : W/N (강화학습에서 action-value function Q이다)
그렇다고 max Q값만 그러면 찾아가면 되는 것인가?
하지만 강화학습 길 찾기 문제에서도 그랬듯이 더 나은 방법이 있는지 확인하기 위해 탐험을 해봐야 한다
Exploitation : 좀더 이길 가능성이 높은 쪽으로 파봐야 한다
Exploration : 많이 탐험되지 않은 쪽으로 파봐야 한다
AlphagoZero에서의 MCTS
Where u is
AlphagoZero에서의 MCTS
AlphagoZero에서는 다음과 같은 수식에 따라 selection을 진행한다
AlphagoZero에서의 MCTS
재밌게도 tree의 policy 𝜋를 계산하기 위해서 Q를 쓰지 않는다. 대신 N(visit count)을 쓴다
- 반복이 끝나 후에 Q값이 높은 것이 많이 방문되었을 것이다
- N을 사용하는 것이 outlier에 덜 취약
- 𝜏 → 0은 highest count만 선택, 𝜏 = 1탐험도 허용
AlphagoZero에서의 MCTS
AlphagoZero의 NN구조
- Input 형태 (state라는게 정확히 어떤 구조?)
- Output이 어떻게 2개..?
- 바둑같은 경우는 현재 상태만 보고서는
뭐가 어떻게 된 것인지 알지 못한다
- 검은 돌의 현재 상태(1) + 이전(7) +
흰 돌의 현재 상태(1) + 이전(7) +
total 상태(1) 이렇게 총 17개의 stack으로
구성된 것이 1개의 state이다
AlphagoZero의 NN구조
AlphagoZero의 NN구조
AlphagoZero의 NN구조
전체 alphago Zero의 구조

More Related Content

More from 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
 
GAN - Generative Adversarial Nets
GAN - Generative Adversarial NetsGAN - Generative Adversarial Nets
GAN - Generative Adversarial NetsKyeongUkJang
 
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 20 Deep generative models
Chapter 20 Deep generative modelsChapter 20 Deep generative models
Chapter 20 Deep generative modelsKyeongUkJang
 
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
 

More from 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
 
GoogLenet
GoogLenetGoogLenet
GoogLenet
 
GAN - Generative Adversarial Nets
GAN - Generative Adversarial NetsGAN - Generative Adversarial Nets
GAN - Generative Adversarial Nets
 
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 20 - VAE
Chapter 20 - VAEChapter 20 - VAE
Chapter 20 - VAE
 
Chapter 20 Deep generative models
Chapter 20 Deep generative modelsChapter 20 Deep generative models
Chapter 20 Deep generative models
 
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
 

AlphagoZero

  • 1. AlphaGo Zero, How it works? 이정현
  • 2. AlphaGo Zero는? • AlphaGo 이후 DeepMind 에서 수정해서 2017년에 배포한 새로운 버전 • 사람의 지식 없이도 스스로 학습 가능해졌음 • 학습시간도 더 짧아지고 모형도 더 단순함
  • 3. • 먼저 AlphagoZero의 대략적인 구조를 먼저 살펴보고 • MCTS • AlphagoZero의 NN구조 • 둘이 합친 버전을 보자 Contents
  • 4. AlphaGo Zero 구조 MCTS에서는 노드를 확장하면서 NN에 데이터를 제공하는 역할을 NN는 해당 state에서 policy와 value를 예측하는 역할을 한다
  • 5. 모델을 전부 학습한 이후에 결론적으로 state를 input으로 넣으면 P (policy) V (value function) 어떤 행동을 취할지에 대한 확률 값들 state가 얼마나 좋은지를 평가, [-1, 1]의 값 예시 ) V3 = 0.5 예시 ) P3= [0 : 0.1 , 1 : 0.2 , 3 : 0.4 , 4 : 0.1 , 5 : 0.2 ] AlphaGo Zero 구조
  • 6. MCTS(Monte Carlo Tree Search) MCTS는 이전부터 최종적으로 게임을 이기위해서 다 음 수를 예측해 나가는 방법으로 자주 쓰였다 트리형태로 노드를 확장해 나가면서 다음 수를 찾아감
  • 7. 순수한 MCTS 알고리즘 •Selection: 루트 R에서 시작하여 연속적인 자식 노드를 선택해 내려가 마디 L에 이른다. •Expansion: 노드 L에서 승패를 내지 못하고 게임이 종료되면, 하나 또는 그 이상의 자식 노드를 생성하고 그 중 하 나의 노드 C를 선택한다. •Simulation: 노드C로부터 무작위의 플레이아웃을 실행한다. •Backpropagation: 플레이아웃의 결과로 C에서 R까지의 경로에 있는 노드들의 정보를 갱신한다. max min max
  • 8. AlphagoZero에서의 MCTS 각 node는 board판 state이고 , edge는 다음 move를 나타낸다. Deep network f 를 통해 s’3의 이길 가능성(value)가 0.9이고 다음 move의 확률들을 알 수 있다
  • 9. AlphagoZero에서의 MCTS AlphagoZero에서 MCTS를 진행하면서 업데이트 하는 값은 W, N, Q이다 W : 선택한 V 값들의 합 N : node 방문 횟수 Q : W/N (강화학습에서 action-value function Q이다)
  • 10. 그렇다고 max Q값만 그러면 찾아가면 되는 것인가? 하지만 강화학습 길 찾기 문제에서도 그랬듯이 더 나은 방법이 있는지 확인하기 위해 탐험을 해봐야 한다 Exploitation : 좀더 이길 가능성이 높은 쪽으로 파봐야 한다 Exploration : 많이 탐험되지 않은 쪽으로 파봐야 한다 AlphagoZero에서의 MCTS
  • 11. Where u is AlphagoZero에서의 MCTS AlphagoZero에서는 다음과 같은 수식에 따라 selection을 진행한다
  • 13. 재밌게도 tree의 policy 𝜋를 계산하기 위해서 Q를 쓰지 않는다. 대신 N(visit count)을 쓴다 - 반복이 끝나 후에 Q값이 높은 것이 많이 방문되었을 것이다 - N을 사용하는 것이 outlier에 덜 취약 - 𝜏 → 0은 highest count만 선택, 𝜏 = 1탐험도 허용 AlphagoZero에서의 MCTS
  • 14. AlphagoZero의 NN구조 - Input 형태 (state라는게 정확히 어떤 구조?) - Output이 어떻게 2개..?
  • 15. - 바둑같은 경우는 현재 상태만 보고서는 뭐가 어떻게 된 것인지 알지 못한다 - 검은 돌의 현재 상태(1) + 이전(7) + 흰 돌의 현재 상태(1) + 이전(7) + total 상태(1) 이렇게 총 17개의 stack으로 구성된 것이 1개의 state이다 AlphagoZero의 NN구조