Homework 4

Machine Learning

Shlomo Hershkop

Introduction

The main goal of my project was to create a player to beat Edgar. It was motivated out of pure revenge, after I lost 3 games in a row to Edgar J . In addition I experimented with complexity, population size, and generation numbers on the performance of the "beat-up Edgar" player, and how it compared to the random player.

So the main focus was varying the learning method by training against Edgar, as opposed to random player. And varying different combinations of Genetic players to ‘breed’ the best player.

Changes:

The GPOthello was changed to train against Edgar, and OthelloDisplay was changed to play this player as black against Edgar and random.

 

Runs:

Parameters:

Test1:

PopulationSize = 200

NumberOfGenerations = 10

CrossoverProbability = 90.0

CreationProbability = 0.0

CreationType = RampedHalf

MaximumDepthForCreation = 6

MaximumDepthForCrossover = 15

MaximumComplexity = 100

SelectionType = Probabilistic

TournamentSize = 7

DemeSize = 100

DemeticMigProbability = 100.0

SwapMutationProbability = 20.0

GoodRuns = 3

AddBestToNewPopulation = false

TestDiversity = false

Test2:

PopulationSize = 50

NumberOfGenerations = 51

CrossoverProbability = 90.0

MaximumDepthForCreation = 6

MaximumDepthForCrossover = 17

MaximumComplexity = 100

 

Test3:

PopulationSize = 20

NumberOfGenerations = 51

CrossoverProbability = 90.0

CreationProbability = 0.0

CreationType = RampedHalf

MaximumDepthForCreation = 10

MaximumDepthForCrossover = 17

MaximumComplexity = 100

SelectionType = Probabilistic

TournamentSize = 7

DemeSize = 100

 

Test4:

PopulationSize = 20

NumberOfGenerations = 51

CrossoverProbability = 90.0

CreationProbability = 0.0

MaximumDepthForCreation = 10

MaximumDepthForCrossover = 17

MaximumComplexity = 100

AddBestToNewPopulation = true

TestDiversity = true

All those were trained against Edgar, test5 was trained against random:

Test5:

PopulationSize = 100

NumberOfGenerations = 20

CrossoverProbability = 50.0

CreationProbability = 5.0

CreationType = RampedHalf

MaximumDepthForCreation = 6

MaximumDepthForCrossover = 15

MaximumComplexity = 150

SelectionType = Probabilistic

TournamentSize = 7

DemeSize = 100

DemeticMigProbability = 100.0

SwapMutationProbability = 50.0

 

 

Results:

From test1:

( / white_edges ( + white_edges ( * white_corners black_edges )))

was able to tie Edgar, against random wins 34/30.

So was this able to tie Edgar:

( + white_edges ( - white_edges ( * white_corners black_edges )))

and it was 37/27 against random.

run number 25 gave:

( / ( * white_near_corners white_edges ) ( / black_edges white ))

WIN against Edgar!! 34 to 30

Loses against Random: 37 to 27

 

Test2:

Ties Edgar :

"/ black ( / ( - ( + ( - ( / ( / ( / black white_edges ) white_edges ) white_edges ) white_edges ) white_corners ) white_edges ) white_edges )"

and gets 36/28 out of random.

wins 33 to 31:

( / black ( / ( - ( - black white_edges ) white_edges ) white_edges ))

that was against Edgar, against random: loses 36/28

 

test3:

none even a tie, the most interesting was:

( / ( / ( - black black_near_corners ) white_edges ) white_edges )

which has black controlling the board most of the game has complete edges (except corners) then white grabs almost all!

Against random:

Wins 49 to 0

 

 

 

 

Test4:

Tied against Edgar:

( - ( / ( - ( / black_edges white_edges ) black_edges ) white_edges ) black_edges )

loses 47/17 against random.

 

Test5:

( * ( / ( - ( + black_corners white_edges ) ( / black_edges white_edges )) ( / ( * white_edges black_corners ) ( + black_edges black_near_corners ))) ( / ( * ( - 10 white_near_corners ) ( * black_near_corners black )) ( + ( + black black_corners ) ( - black_edges black_near_corners ))))

 

Loses Edgar 42/22

Wins against random 40/24

 

 

 

 

 

Conclusion:

1: someone made a statement in class that it was impossible to beat Edgar with the current representation, so this was proven wrong, both test1, and test2 learned Edgar enough to win, although lost the random player. It might have been interesting to note how the population would fare if the fitness involved playing against Edgar and random, but there was not enough time to implement this. As it is the runs took forever, I was running each test on my computers at home (450 Pentium III, and 400 Pentium II) each test was allowed 4 days to run.

2. from the test 3 and 4 it is clear that a population 20 is too small to allow GA to do its stuff. The players were inadequate at best and even carrying the best to the next generation didn’t help.

3. other tests against a random player were inconclusive the players fitness kept swinging and wouldn’t settle down the way it did against training against Edgar.

4. in short from what time I had, I see that the greater the population the better players evolved both in the tying and beating Edgar, in theory a population of 500 for 50 generations would have produced a player to really conquer Edgar J but there wasn’t enough time to test this idea.