sjhalayka

Blind Poker Artificial Neural Network

Recommended Posts

sjhalayka    3

So I took a couple of days off and went the ANN route. The code is up at: https://github.com/sjhalayka/bpai

I play 1 pseudorandom computer player versus 4 ANNs, for 5 players altogether. No training is needed for the player who wins. It's when the ANN loses that its choices are negated (e.g. if(0 == floor(value + 0.5)) { value = 1; } else { value = 0; } ) and fed into the back propagation function. Seeing how the error rate settles down to some constant number, only the maximum number of training sessions is what's used to terminate the learning process.

For 4 players to 2 players, I play 3 to 1 ANNs. Altogether, for 2 players, 3 players, 4 players, and 5 players, there are 10 ANNs.

... now back to the hard-coded AI.

Edited by sjhalayka

Share this post


Link to post
Share on other sites
sjhalayka    3

In order to play the game, the computer player needs to know what the best possible rank (Royal Flush, etc) their current hand can make. Cards in one's hand that are still not shown are treated as wild cards. Only cards that are currently not shown on the entire table are used to make the best possible rank.

Once the best possible rank is obtained, one then temporarily takes a card from either the discard or pickup pile and runs that hand through the best possible rank function. If this temporary rank is less than the best possible rank, the card is not taken on a permanent basis.

This is not perfect, but it does the trick far better than a computer player who choses the discard pile or pickup pile cards pseudorandomly.

Edited by sjhalayka

Share this post


Link to post
Share on other sites
sjhalayka    3

That's a good idea, but I promised someone that I'd write a guest post on their blog about the game's innards once it's all finished. I promise not to post here too often, in the forums.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now