Nick Harris

Archive for November 2017

Super Euchre and Machine Learning

leave a comment »

As much as I loved learning about ARKit at Swift by Northwest, the talk that really caught me intellectually was Chris Parrish‘s talk about machine learning.

Chris’s talk was based on an iPad app that could learn if a user had drawn a circle, square or triangle with their finger.

I haven’t dug into how it all works at all so I’m basing this post just on how Chris described how neural networks work and how the things he was describing relate to how I wrote Super Euchre.

What I got out of Chris’s talk was that machine learning is done by taking an action and passing it through an mesh of manipulators that adjust some outcome value either positively or negatively. The end result is then used to make some decision.

This is – at a very high level – how Super Euchre’s AI works.

My code for Super Euchre takes an array of cards and assigns a weight to them based on what suit could be called trump. The total of those weights is what is used to make decisions about calling trump. It gets adjusted based on a set of inputs around game state. If the total weight after all the adjustments meets certain totals then calling trump for a particular suit is either passed, called, called alone or called alone with help.

Playing a particular card is still done the original way I wrote all of Euchre which is a big if/else statement. I’ve been wanting to move that to a weight based approach as well. I never did it simply because I wasn’t sure if the weight based idea was the best.

After seeing Chris’s talk I’m absolutely convinced that weight based decision making is the way to go.

What I want to do now is learn about Core ML and see if I can use how a user plays their hand to train the AI players. If that works I wonder if I can then pool all active users and how they play their hands to train AI players.

I have alpha server code that can take data played by all active users of Euchre and store it for processing. Its something I’ve wanted to do for years but haven’t deployed. 

If I can use that data to pump through some sort of Core ML setup to make Euchre amazing?

Sign me up.

Just need to dig in more and see if its feasible… and ethical…

 

Advertisements

Written by Nick Harris

November 19, 2017 at 6:00 am

Posted in Uncategorized