39
HOW MACHINES LEARN TO PLAY OFE R EG OZI

Learning to Play: History of Machine Learning in Classic Games

Embed Size (px)

Citation preview

Page 1: Learning to Play: History of Machine Learning in Classic Games

HOW MACHINES LEARN TO

PLAY

O F E R EG O Z I

Page 2: Learning to Play: History of Machine Learning in Classic Games

ARTIFICIAL INTELLIGENCELet’s start from the basicsActually, let’s go straight to the cutting edge!Here’s a demo for a multi-layered convolutional neural

network using feed-forward training to perform supervised learning

Page 3: Learning to Play: History of Machine Learning in Classic Games

Well-defined rulesA clear, measurable goalA task one can train forBonus: human opponents!

Page 4: Learning to Play: History of Machine Learning in Classic Games
Page 5: Learning to Play: History of Machine Learning in Classic Games

THE ‘ADDITRON’

Josef Kates1950

Page 6: Learning to Play: History of Machine Learning in Classic Games

Josef Kates1950

Page 7: Learning to Play: History of Machine Learning in Classic Games

EARLY DAYS – MINIMAXBuild a tree of game states

(from current state) Well-defined transition rules

Define a function to score each state

How close are we to the goal (a winning board)?

Choose path that maximizes our gain and minimizes opponent’s gains

Page 8: Learning to Play: History of Machine Learning in Classic Games

Toc-Tac-Toe has only 765 unique states… Solved!!

Page 9: Learning to Play: History of Machine Learning in Classic Games
Page 10: Learning to Play: History of Machine Learning in Classic Games

5 x 1020 (500 billion billion) possible positions

Page 11: Learning to Play: History of Machine Learning in Classic Games

Arthur L. Samuel1956

Page 12: Learning to Play: History of Machine Learning in Classic Games

1989Chinook

Page 13: Learning to Play: History of Machine Learning in Classic Games

1992

Page 14: Learning to Play: History of Machine Learning in Classic Games

Marion Tinsley

Page 15: Learning to Play: History of Machine Learning in Classic Games

199219941995

“With his passing, we lost not only a feared adversary but also a friend. Every member of our team had the deepest respect and admiration for Tinsley. It was a privilege to know him”

Page 16: Learning to Play: History of Machine Learning in Classic Games

2007

Page 17: Learning to Play: History of Machine Learning in Classic Games

10120 possible positions (checkers squared)

Page 18: Learning to Play: History of Machine Learning in Classic Games
Page 19: Learning to Play: History of Machine Learning in Classic Games

1950

Page 20: Learning to Play: History of Machine Learning in Classic Games

1957

160,000 positions per second1980

Alpha-beta pruning

Page 21: Learning to Play: History of Machine Learning in Classic Games

19961997

200 million positions per second

Page 22: Learning to Play: History of Machine Learning in Classic Games

GENERIC LEARNING

So far, humans were central in the learning process

Pre-encoding the allowed movesProviding the winning states

Can machines learn on their own, like real toddlers?

Page 23: Learning to Play: History of Machine Learning in Classic Games
Page 24: Learning to Play: History of Machine Learning in Classic Games
Page 25: Learning to Play: History of Machine Learning in Classic Games

2013

https://arxiv.org/pdf/1312.5602v1.pdf

Page 26: Learning to Play: History of Machine Learning in Classic Games

1) 33600 raw pixels2) Target scoreInput:

2013

Output: player!

Page 27: Learning to Play: History of Machine Learning in Classic Games

• We’re skipping entire ML courses now

• What’s fundamentally different about Deep Learning?• No predefined rules – a generic system• “A bishop moves this way, and a knight this way…”

• No domain knowledge – system “finds” the features• “count #pieces within 3 steps from the king”

DEEP LEARNING

Page 28: Learning to Play: History of Machine Learning in Classic Games

• We’re skipping even more entire ML courses now

• Uses Artificial Neural Network, with LOTS of data• Deep Learning == multiple hidden layers

DEEP LEARNING

Magic happens HERE…Magic built-in

Page 29: Learning to Play: History of Machine Learning in Classic Games

Showtime!

DEEP LEARNING IN 8-BIT

Page 30: Learning to Play: History of Machine Learning in Classic Games

2016#positions > #atoms in universe1202 CPUs and 176 GPUs

GO

Page 31: Learning to Play: History of Machine Learning in Classic Games

HOW ABOUT AI BUILDING THE GAME?...

Page 32: Learning to Play: History of Machine Learning in Classic Games

GENERATIVE LANGUAGE MODELS

• Not done with skipping ML courses just yet • First, let’s divert to literature for a bit, shall we?...

• “Robert Cohn was once middleweight boxi?”

https://medium.com/@ageitgey/machine-learning-is-fun-part-2-a26a10b68df3

Page 33: Learning to Play: History of Machine Learning in Classic Games

GENERATIVE LANGUAGE MODELS

• Feed the book into an RNN, let it train itself…100 iterations:

1000 iterations:

Page 34: Learning to Play: History of Machine Learning in Classic Games

GENERATIVE LANGUAGE MODELS

• Feed the book into an ANN, let it train itself…<10K iterations:

Page 35: Learning to Play: History of Machine Learning in Classic Games

GENERATIVE MODELS

• Now back to games…

Page 36: Learning to Play: History of Machine Learning in Classic Games

GENERATIVE MODELS

• Extracted and encoded all game levels• Initial iterations build junk• After enough training iterations – it works!

Page 37: Learning to Play: History of Machine Learning in Classic Games

THANK YOU!

Page 38: Learning to Play: History of Machine Learning in Classic Games

GENERATIVE ADVERSARIAL NETWORKS (GANS)

Page 39: Learning to Play: History of Machine Learning in Classic Games

GENERATIVE MODELS – MUSIC