Poker Neural Net Rating: 7,3/10 8725 reviews
Katie Callahan

DeepStack, one of many recent computers to face off against human beings, defeated 11 professional poker players in heads-up no-limit hold’em, according to a study published in Science this month.

Network

We reprogrammed our Neural Network to totally rework the already potent Neural Strategy, one of the world’s most highly acclaimed gambling strategies! We developed the Super Neural Strategy. This strategy increases the efficiency of the original Neural Strategy by over 50% and reduces the bankroll requirements at the same time! The computer looked up two copies of the same network in its neural network, namely for the first three shared cards and then again for the final two, trained on 10,000 randomly drawn poker games. CU Neural Networks Reading Group Dec 2, 2015. This work is not complicated. Fully explaining the problem would take all available time. Our network plays three poker games – Casino video poker – Heads up (1 on 1) limit Texas Hold’em.

NetNeural

Of the 11 players, DeepStack defeated 10 of them in December 2016 by statistically significant margins after the study authors had the computer undergo deep learning training to teach the bot to develop poker intuition for any situation.

The computer looked up two copies of the same network in its neural network, namely for the first three shared cards and then again for the final two, trained on 10,000 randomly drawn poker games, reported Ars Technica.

The researchers recruited 33 players through the International Federation of Poker.

Only 11 players finished 3,000 matches over the course of a four-week period and DeepStack’s neural networks were what allowed it to essentially “learn” and model higher-level concepts while it ran on a gaming laptop (NVIDIA GTX 1080). DeepStack was developed by researchers at the University of Alberta and a number of Czech universities.

DeepStack works through situations as humans would, learning pieces of the game as it goes and create a strategy to defeat the humans.

“In some sense this is probably a lot closer to what humans do,” said Michael Bowling, professor of machine learning and the study author, to Scientific American. “Humans certainly don’t, before they sit down and play, precompute how they’re going to play in every situation. And at the same time, humans can’t reason through all the ways the poker game would play out all the way to the end.”

DeepStack isn’t the only artificial intelligence out there. Carnegie Mellon’s Libratus recently beat four professional players with a more elite status on a supercomputer. Its technology is similar to that of DeepStack in the later stages of computing but it does not use the same neural networks, according to Scientific American. DeepStack also won by larger margins.

Past attempts with Claudico didn’t pan out, but Google DeepMind’s Alpha Go beat pros at the game, go. Even more notably, 20 years ago, Deep Blue beat World Chess Champion Garry Kasparov at his own game.

This finding reveals a lot about artificial intelligence’s ability to master imperfect information games beyond abstraction (or computing how to play in every situation before the game begins).

Lead image courtesy of Thigala shri/Flickr

  • Tags

    Poker PlayersAI
Poker

After spending a few weeks reading up on “Artificial Neural Networks”, I decided to pick a project that would cement my understanding of them. I was especially taken with Deep Mind’s single Q-Learning algorithm that was able to learn to play almost any Atari game! Their idea is a mix of the best of the old with the new, really cool. The downside of oldschool Q-learning is that it pretty much has to visit every state in a game, take all possible actions from that state, and memorize the action with the best result. For anything bigger than Pacman, this is a huge problem! What Deepmind did was take Q-learning’s huge state table and instead approximate that table with a trained Neural Net. This has the added advantage in that given a previously unvisited state, the Neural Net (NN) can still make a great educated guess about the best action, whereas Q-learning would have no clue! There’s a ton of other benefits that’s well-documented elsewhere, but I decided to apply this super-generic algorithm to Heads Up Limit Poker since the Atari solutions work out-of-the-box.

The setup

In 2017, the most cutting-edge NN library seems to be Tensorflow with Keras, which meant dusting off my old Python toolkit. Combined with a ton of open source Python Poker libs, it turned out as the best tool for the job. Interestingly, NN’s sort of turn into a Declarative Programming language, where you give it a description of the problem (Maximize the reward function for poker that pays out the pot) and an input state (known cards and action history). The output of the NN in Q-learning is an action distribution such as (20% Fold, 40% Call, 40% Raise). As usual in Declarative programming, the input and environment is all that’s needed to magically get a roughly correct result. For NN’s there’s a lot of thought that needs to go into minimizing your representation of the state. For example, Holding an Ace Queen is the same as holding a Queen Ace, so I make sure to sort the cards first to greatly minimize the input state. The more condensed your input state, the less “knobs” your net will have and learning will speed up dramatically.

Initial Results

With PyCharm, 2 poker libs, and Tensorflow, I created a fake hardcoded poker agent that pretty much just plays the odds and trained my NN against it. Since my setup essentially assumes that every game is the first time 2 players have met each other, playing the odds is a pretty good strategy. Indeed, my naive net (even with some optimizations like Prioritized Experience Replay) was only able to reach an average loss of 1 chip per game! This is mostly due to my laziness/cheapness as more training would have improved it I’m sure. The NN went from losing an average of 3 chips a game to 1 chip with about 24 hours of training and trying 8 different NN architectures. Just like NP-hard declarative programming, you need to spend a lot of time tuning your declarative engine, in this case I ended up with 3 fully connected layers linking to a binary tree shape of neural connections. The best insight I can give here is thinking “What does the optimal poker brain look like?” In my testing (far too little though!) this worked out. I figure there needs to be some fully connected layers so that it could learn high-level features like win-rate probabilities, then funnel that through some magical series of reducing functions that end up producing 3 possible actions, hence the shape! I tested that against straight binary trees and straight flat maps. An ensemble of the 2 worked out better than any pure approach.

Poker Neural Net

Improvements

With my curiosity mostly satisfied, I realized many possible improvements like using 1 NN per round. This would be handy since on pre-flop, the state is much tinier (only 169 unique hands!). Training this network specifically for pre-flops would take waaaayyyy less time and be way more accurate than my general naive net. Indeed, after more poking around, this is exactly what DeepStack, a state-of-the-art poker bot is doing! They have networks for 3 rounds and mix this with a perfect game-theoretic approach which combine to approximate a perfect Nash Equilibrium strategy! This is just too cool, so I’ve started to write the game-theoretic piece on top of what I’ve written so far. I’ll post my results when it’s done, but don’t bother asking for the source! 😛

Poker Neural Network

NN Takeaway

Wow, I’m an avid tool collector, but I’m never swung a hammer like this. NN’s are UNIVERSAL FUNCTION APPROXIMATORs. That’s huge. This is easily the most flexible piece of machine learning ever. The only requirements are:

  1. You have to be willing to accept 90-something percent accuracy
  2. You need lots and lots of data, or a way to generate data (like poker games 🙂 )
  3. You need to know what you’re doing. Always tune your declarative engines!
  4. Lots of compute, the more the better.

Poker Neural Network Github

Society?

Poker Neural Network Example

If I were a betting man (I only build betting men), I’d say this tech won’t be great for society or culture. There’s only a handful of companies that have the levels of data needed for sophisticated NN’s, and they know it. Google likes to throw Tensorflow around while stating that they’re trying to open up Deep Learning to everyone. In the end this makes good business sense; have the open source community find the best methodology while Google is the only one with the data to use it effectively ;-P . NN’s allow you to automate many tasks to beyond human levels, and the companies that use it will have an unbeatable automation advantage. This is already happening now in case you didn’t notice, with Amazon taking over dozens of unrelated markets because of their sheer efficiency and access to massive hardware, which NN’s and machine learning generally require. Some of the guys behind DeepStack’s tech are trying to reapply their approach to contract negotiations by viewing it as a poker-like imperfect information game. Imagine Amazon automating their interactions with the gov so that they optimize not being broken up as a monopoly, the only likely way their acceleration would be curbed. Maybe worse, NN’s are a great way to direct users to whatever you’d like with ever greater accuracy. This means that those with well trained NN’s will by-and-large control media consumption even more so than now.

On the other hand, we’re going to need all the smarts we can get in terms of weather prediction etc. At current, the private sector seems to almost exclusively be using this open source tech! Let’s hope those of us with this power aim this wizardry toward the mountain of problems quickly heading our way. I will, right after I’m tired of taking your money on Pokerstars.

Poker Bot Neural Network

I’m not worried about the singularity any time soon, but I do fear the few who could come to own it. I’d prefer hitting pause on all machine learning research, but since that’s utterly impossible, the next best thing is to make sure we’re all armed with this knowledge!