monte-carlo go overview

32
Monte-Carlo Go Overview ohyecloudy http://ohyecloudy.com 아꿈사 http://cafe.naver.com/architect1.cafe 2010.5.15

Upload: jongbin-oh

Post on 13-Dec-2014

2.449 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Monte-Carlo Go Overview

Monte-Carlo Go Overview

ohyecloudy http://ohyecloudy.com

아꿈사 http://cafe.naver.com/architect1.cafe

2010.5.15

Page 2: Monte-Carlo Go Overview

• Monte-Carlo method ? • BadukGo AI

• Monte-Carlo Go

– overview

– simulated annealing

– simulated annealing for tree searches

– Gobble approach

• result

Page 3: Monte-Carlo Go Overview

랜덤random

샘플링으로 계산하는

알고리즘

Page 4: Monte-Carlo Go Overview

알고리즘

1. 큰 집합에서 여러 원소를 마구잡이로 골라냄.

2. 원소 하나하나가 어떤 성질을 따르는지 따져본다.

3. 모든 실험 결과를 한데 모아서 정리해 확률 값을 얻는다.

4. 확률 값을 바탕으로 어떤 결론을 이끌어 낸다.

Page 5: Monte-Carlo Go Overview

(define (monte-carlo trials experiment)

(define (iter trials-remaining trials-passed)

(cond ((= trials-remaining 0) ; 종료 조건

(/ trials-passed trials))

((experiment) ; 평가 함수가 통과하면

(iter (- trials-remaining 1) (+ trials-passed 1)))

(else ; 평가 함수가 통과하지 않는다면

(iter (- trials-remaining 1) trials-passed))))

(iter trials 0))

랜덤 입력를 만들어내는 프로시저

어떤 성질을 따르는지 평가하는 프로시저

통과하면 값을 증가 시킨다. 결과값.

Page 6: Monte-Carlo Go Overview

2

2

trials-passed 카운팅 제외

이 원 안에 들어온 점 개수 만큼 trials-passed에 더해준다.

평가 함수 x2 + y2 ≤ 1

1000개 중에 785개가 통과했다면 2 * 2 * (785 / 1000) = 3.14

Page 7: Monte-Carlo Go Overview

응용applications

physical sciences

design and visuals

finance and business

telecommunications

games

Page 8: Monte-Carlo Go Overview

• Monte-Carlo method ?

• BadukGo AI • Monte-Carlo Go

– overview

– simulated annealing

– simulated annealing for tree searches

– Gobble approach

• result

Page 9: Monte-Carlo Go Overview

38/365: Game of Go (碁) - Rrrodrigo

Page 10: Monte-Carlo Go Overview

Design philosophies

• Minimax tree search – 전통적인 AI 기술 – 상대에 대한 최소값을 찾음으로써 플레이어 자신에 대한 최대값

을 찾는다.

• Knowledge-based systems

– heuristics, pattern recognition, pattern matching

• Monte-Carlo methods

• Machine learning

– genetic algorithm, neural network

Page 11: Monte-Carlo Go Overview

AI에 있어 바둑이란?

• 놓을 수 있는 위치가 제한되고 완벽한 정보가 있는 게임.

• 체스와 다르게 특정 지역을 제외하곤 아무 곳에나 말을 놓을 수 있다. – 게임 트리를 구축하면 체스와 비교도 안 되게 폭

발하는 이유.

• 미칠듯이 방대한 게임 트리

– 트리 서치를 brute force로 하면 답이 없다.

Page 12: Monte-Carlo Go Overview

• Monte-Carlo method ?

• BadukGo AI

• Monte-Carlo Go

–overview – simulated annealing

– simulated annealing for tree searches

– Gobble approach

• result

Page 13: Monte-Carlo Go Overview

어떻게 하면

사람이 두는 것처럼

바둑을 둘 수 있을까?

Page 14: Monte-Carlo Go Overview

바둑 AI 기본 요소

1. 행마 순서를 예측해서 나열해본다.

2. 말을 놓을 위치에 값을 매긴다.

3. 1과 2를 조합해서 다음 말을 놓는다.

Page 15: Monte-Carlo Go Overview

Monte-Carlo Go 기본 요소

1. simulated annealing 방법으로 확률 값을 할당하고 랜덤하게 행마를 한다. – 실제 말을 놓는 건 아님. 시뮬레이션.

2. 게임이 끝났을 때를 기준으로 각 위치 값을 구한

다.

3. 1로 선택된 위치를 2번으로 평가하는 걸 여러 번 반복해서 평균 값을 고르고 가장 높은 값에 말을 놓는다. – 반복횟수로 난이도 조절. 쉽다.

Page 16: Monte-Carlo Go Overview

• Monte-Carlo method ?

• BadukGo AI

• Monte-Carlo Go – overview

–simulated annealing – simulated annealing for tree searches

– Gobble approach

• result

Page 17: Monte-Carlo Go Overview

local minimum

global minimum

각 스텝에서 랜덤으로 주변 위치를 찾는다. 온도 T가 감소하는 방향으로 기본적으로 이동. 올라가는 것도 허용.

야금학 담금질에서 따온 것. 결함을 작게 하려고 금속에 열을 가하고 냉각하는 기술

목표

Page 18: Monte-Carlo Go Overview

바둑에 사용한다면

• local minimum

– 이번 턴에 말을 놨을 때 얻는 이득

• global minimum

– 이번 턴에 말을 놨을 때 게임이 끝난 시점에서 계산한 이득

Page 19: Monte-Carlo Go Overview

• Monte-Carlo method ?

• BadukGo AI

• Monte-Carlo Go – overview

– simulated annealing

–simulated annealing for tree searches

– Gobble approach

• result

Page 20: Monte-Carlo Go Overview

• 가지치기pruning가 필요

– 방대한 트리에서 일부분을 제외해야지 계산할 만하다.

• 어떻게 가지치기를 해야 할까?

– local minimum에 빠지기 십상.

Page 21: Monte-Carlo Go Overview

• 발견적 교수법heuristics과 랜덤을 사용.

– 여러 번 랜덤으로 말 놓을 놓고 값을 평가한다.

– 이전에 평가한 값이 높았다면 가중치를 준다.

• 단지 분기할 확률만 높일 뿐.

• 강제하지 않는다.

– 결국 가중치와 랜덤으로 global minimum으로 갈 확률을 높여준다.

Page 22: Monte-Carlo Go Overview

그러나

Page 23: Monte-Carlo Go Overview

• 트리 Depth가 너무 깊다.

• 평가 함수도 무거움

– 게임이 끝날 때까지 시뮬레이션 해봐야 한다.

• 대전

– 상대방이 어떻게 놓느냐를 정확히 예측할 수 없음.

– 그럼 과연 local minimum이 무엇을 가리키는 것일까?

Page 24: Monte-Carlo Go Overview

• Monte-Carlo method ?

• BadukGo AI

• Monte-Carlo Go – overview

– simulated annealing

– simulated annealing for tree searches

–Gobble approach

• result

Page 25: Monte-Carlo Go Overview

simulated annealing 수정

• 제한된 확률을 넣었다.

• greedy strategy도 선택적으로 사용.

Page 26: Monte-Carlo Go Overview

랜덤 게임을 시뮬레이션 이득

• 상대편이 어떤 짓거리를 해도 분명 좋은 수가 있다. – 하나만 돌을 놓으면 상대방 돌을 잡는 수.

• 선수先手가 무척 중요

– 랜덤으로 걸리기도 함.

• “always look for the biggest move on the

board” – 바둑 초보자가 노쌍 듣는 말. – 랜덤 게임으로 더 이익이 큰 행마를 할 수 있다.

Page 27: Monte-Carlo Go Overview

• Monte-Carlo method ?

• BadukGo AI

• Monte-Carlo Go

– overview

– simulated annealing

– simulated annealing for tree searches

– Gobble approach

• result

Page 28: Monte-Carlo Go Overview
Page 29: Monte-Carlo Go Overview
Page 30: Monte-Carlo Go Overview

Monte-Carlo Go Program

• The Many Faces of Go v12 – 2008 Computer Olympiad

• Leela

• MoGo – 2007 Computer Olympiad

– Guo Juan(프로 5단) 에게 3판 중 1판 이김. 9X9

• Crazy Stone

• Olga

• Gobble

Page 31: Monte-Carlo Go Overview
Page 32: Monte-Carlo Go Overview

Reference

• Monte-Carlo Method – Wikipedia – http://en.wikipedia.org/wiki/Monte_Carlo_method

• Computer Go – Wikipedia – http://en.wikipedia.org/wiki/Computer_Go

• Monte Carlo Go – http://www.ideanest.com/vegos/MonteCarloGo.pdf

• Simulated annealing – http://en.wikipedia.org/wiki/Simulated_annealing

• SICP • 38/365: Game of Go (碁) - Rrrodrigo

– http://www.flickr.com/photos/rrrodrigo/4339468579/