Open Side Menu Go to the Top
Register
Will Tipton Video Pack 2 - Solving Poker Will Tipton Video Pack 2 - Solving Poker

08-20-2014 , 12:23 AM
Quote:
Originally Posted by X0RR0
In the video you show that for BB in the turn situation AhKsQd2d, certain hands are indifferent between checking and betting.
I don't have exactly the same range for SB as I added some pocket pairs: 99,66.
The only hand I can find which BB plays 50/50 is T6o : ranges[1].getAmbiFrac = 0.50275,
ranges[15].getAmbiFrac = 0.49725 ; but the evs are not near enough for indifference:
evs['BB'][1] = 19.7167 while
evs['BB'][15] = 19.6735.
Is there a bug or 300 iterations not enough, or is there no reason to have indifferent hands. That would deter me as most of the reasoning in the two volumes for a play is based on making villain indifferent on his options?
But I'm not really sure here as SB has done nothing yet except check back with her preflop range...
Well, getAmbigFrac gets the average frequency of all hands that match a pattern like XYs or XYo. However, on the river, suits matter -- they can have a large effect on the EVs. So, just because BB is sometimes checking and sometimes betting with some T6o hands doesn't mean he's playing a mixed strategy with any combo in particular.

I think that's enough to account for your confusion, but also, a few hundredths of a BB isn't a huge difference in EVs. Once you find a particular hand combo you think is indiff at equilibrium, try monitoring the difference in EVs each iteration and see how fast it converges. Additionally, playing any mixed strategy at equilibrium implies an indifference -- there's nothing special about a 50/50 mix like you refer to.

Quote:
Also I saw the convergence to the equilibrium with f = 1/(2+n) is somewhat slow (on the order of 1/nIter), I was wondering if we could not get an order (1/nIter²) by using f=1/(2+n/2) or even faster convergence. I see that the solution we get start to oscillate but is that a problem for the convergence?
I believe the algorithm should converge as long as the sequence of mixing factors we use converges to 0 but its partial sums diverge.

Quote:
Other question: I feel a bit lost on how to use the program for preflop play. Say I want to study some situations coming from minraise/limp game tree, I think I should take into account all turn and river cards, but even after reducing the size of the tables, I don't think my computer can handle it. Is there no other way to do that? I was thinking in the way some big games are simulated nowadays with some variants of Monte-Carlo as UCT. Couldn't we not do this in the Fictitious Play algorithm?
Yea, the full game is big. Here's a couple ideas I wrote a while back on the approximating postflop game.

http://forumserver.twoplustwo.com/15...-game-1408420/

Another idea would be to replace whole postflop subtrees with simpler models. Of course, there are also faster algorithms out there as well. I don't quite see how to use MC with FP.
Will Tipton Video Pack 2 - Solving Poker Quote
08-20-2014 , 12:30 AM
Quote:
Originally Posted by checkshovingturns
Hi all.

First of all congrats will for both the books and the video series, they are great.

I´m trying to start with something I was excecting to be easy, but I´m struggling a bit with it. I´m trying to solve the GTO strategy for both BTN and SB in the river, knowing the complete board and the river starting ranges for both players.

The initial stacks I used where 10.000, tree starts in the SB decision (bb can´t lead), and can bet a bit over 50% pot or checkbehind, and BB can fold, call or raise about half pot. SB can only call or fold. Think its a very easy scenario to solve
Is that ten thousand? Those are the effective stacks behind at the beginning of the hand or at the beginning of the river? What's the river pot size? But yea, seems like a very limited number of actions.

Quote:

I added a line in the fictitious play loop showing this:

print "I am " + str(evSB+evBB-20000)+ " away from equilibrium"

If i´m not wrong, this should be 0 if we reach the exact solution.
How are you calculating the EV? You're right that the players' EVs in any spot should sum to the total amount of chips in play, but if you're using the getAvgEVs function we wrote, some card removal effects make it not quite right when used at any decision points except for the beginning of the hand. I talked about this in the video. You can correct for those effects with a bit more work, though.

Quote:

But I think it isnt. Have run up to 30000 iterations of fictitious play and I´m pretty sure its never going to converge to 0. Here are some results:


iteration 473: 20.5156124734 away from equilibrium
iteration 1108: 17.8704847799 away from equilibrium
iteration 5100: 17.4260830438 away from equilibrium
iteration 30000: 16.6990137029 away from equilibrium

I also aded some code to the updateranges function, as I think its never reaching extreme values because of the design of the fraction calculation:

if fracFinal > 0.995:
fracFinal = 1.0
elif fracFinal < 0.005:
fracFinal = 0.0

This way I make sure it never checks behind or just calls with the absolute nuts, or doesnt call the absolute worst hand.

Am i doing something wrong? Shouldn´t I be able to find a pair of strategies that shows I´m zero (or very close) chips away from equilibrium?
Will Tipton Video Pack 2 - Solving Poker Quote
08-20-2014 , 12:40 AM
Quote:
Originally Posted by MrPete
regarding: doFP(minrshoveTree)

The results converge on SB folding 100% and BB folding 100% of hands.

So far:

I've tested with 1 iteration to see if the ranges were initializing correctly and it does seem as if they are.

I've checked my minrshoveTree to see if it correctly matches the books version and it does

My spair.dump() gives me the exact same ranges Will gets in the video, so that code is most likely fine.

I've looked over the code and I cant find any errors.


Does anyone have any advice on how I can diagnose the problem?
Check on your EV calcs -- sounds like that could be the problem, and it's a complicated part of the code.

Fix one player's strategy and calculate the other guy's max expl EV vs it. Then pick one hand combo to focus on, check it's EV at each decision point, and verify those EVs with manual calculation.

For more debugging/diagnosing ideas, see post #16 in this thread.
Will Tipton Video Pack 2 - Solving Poker Quote
08-20-2014 , 12:43 AM
Quote:
Originally Posted by paddling_turtle
I havent started using ipython yet, As i understand one will be able to create nearly everything one wants if one puts the amount of hours in. Will it be possible to create a tool, that shows me how often a certain preflop range hits a specific boards (has a certain handstrength on this board, like Top pair or gutshot). just like a software like flopzilla, but gives out only the raw data..
How long will it take to create somethig like this? and could you give me a guide of how to do it? (I admit i havent worked through the whole video series yet, so excuse me if you do something similiar already)
Yea, you can do anything in iPython that you can do in python, and it's a general purpose programming language. Getting the basic functionality that you describe sounds like something that'd be pretty straightforward to get working in an afternoon for someone with some experience, but if you're just learning the language, it's hard to give a time estimate.

It's not something I've done before, but I guess you just want to take every hand in your range and look at every flop, keep track of how many times you make each type of hand, and take the appropriate weighted averages to get frequencies. The most tedious (and potentially slow) part of this seems like it'll be figuring out exactly what hand you have (pair, twopair, straight, etc) on each board. However, I believe the poker-eval library can do this for you, so I'd check its documentation before trying to roll my own.
Will Tipton Video Pack 2 - Solving Poker Quote
08-20-2014 , 12:51 AM
Quote:
Originally Posted by samooth
is there a page or a post that explains setting up ipython + a compatible equity library under mac os x?
Glad you ask -- I recently looked into it. It turned out to be sort of painful, so I'll document it here in case it helps someone else. I've never really used a Mac much, so no promises that this is the most efficient route.

FWIW, my Mac is running OSX 10.9.3. It came with python installed, and I guess all Macs do? Open a command prompt (i.e a Terminal window) and verify that if you run "python2.7", you get a python prompt.

I ended up not using the Anaconda distribution. Tried it at first, and it was more trouble than it was worth.

So anyway --

1. Install pokereval

- Go here: http://download.gna.org/pokersource/sources/ and download poker-eval-138.0.tar.gz.
- Open a terminal, find the file you downloaded, unzip it with "tar xzvf poker-eval-138.0.tar.gz" and change into the poker-eval-138.0 directory.
- Run: ./configure
- Run: make
- Run: sudo make install

2. Install pkg-config

- Go here: http://pkgconfig.freedesktop.org/releases/ and download pkg-config-0.28.tar.gz.
- Find the file you downloaded in the terminal, decompress it with tar zxvf, and change into the directory.
- Run: ./configure --with-internal-glib
- Run: make
- Run: sudo make install

3. Install Homebrew

- Go here: http://brew.sh/
- Run the command at the bottom of the webpage to install Homebrew

4. Install automake

- Run: brew install automake

5. Install pypoker-eval

- Go here: http://download.gna.org/pokersource/sources/ and download pypoker-eval-138.0.tar.gz.
- Decompress it with "tar xzvf", change into the new directory.
- Run: export CFLAGS="-I/usr/local/include/poker-eval"
- Edit the files Makefile.am, config/ccpython.m4, and config/python.m4, and search and replace all instances of "2.6" and "2_6" with "2.7" and "2_7", respectively.
- Run: autoreconf (if it complains about missing files, run automake --add-missing and then run autoreconf again)
- Edit config/py-compile and delete line 52. (The line says "exit 1" and is right below something about "Missing argument to --destdir" (destdir, not basedir).)
- Run: ./configure
- Run: make
- Run: sudo make install
- Change directories: cd /usr/local/lib/python2.7/site-packages/ and run: sudo mv *pokereval* /Library/Python/2.7/site-packages/

7. Install pip

- Run: curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py
- Run: sudo python2.7 get-pip.py

8. Install iPython and friends

- Run: sudo pip install pyzmq
- Run: sudo pip install jinja2
- Run: sudo pip install tornado
- Run: sudo pip install ipython

Verify that you can open an ipython notebook by running "ipython2 notebook", run "import pokereval" with no errors, and follow along with the intro vids!
Will Tipton Video Pack 2 - Solving Poker Quote
08-20-2014 , 06:03 AM
Quote:
Originally Posted by yaqh
Fix one player's strategy and calculate the other guy's max expl EV vs it. Then pick one hand combo to focus on, check it's EV at each decision point, and verify those EVs with manual calculation.
Unfortunately this is beyond my level of understanding the code (I've tried). If anyone could help get me started on doing this is would be greatly appreciated.

Last edited by MrPete; 08-20-2014 at 06:10 AM.
Will Tipton Video Pack 2 - Solving Poker Quote
08-20-2014 , 07:45 AM
thanks Will
Will Tipton Video Pack 2 - Solving Poker Quote
08-20-2014 , 12:36 PM
Quote:
Originally Posted by MrPete
Unfortunately this is beyond my level of understanding the code (I've tried). If anyone could help get me started on doing this is would be greatly appreciated.
As a beginner at programming, I'd also be grateful for some help on this.

In particular, what is the best way to adapt our code so that we can fix one player's strategy and calculate the the other guy's max expl EV vs it.

Thanks
Will Tipton Video Pack 2 - Solving Poker Quote
08-20-2014 , 09:56 PM
Getting towards the end of the video series, and running into an issue. Have debugged for a long time and can't quite find the problem.

I have successfully programmed through running the Fictitious Play simulation of the large game tree (soln2) of the Details and Example video and am not receiving any errors, but I am receiving slightly, yet clearly wrong results. I also received wrong results in the minrshoveTree equilibrium solution.

Up to running the minrShoveTree equilibrium all of my results have been exactly correct. One interesting occurrence is that the first SB average EV in both simulations is exactly correct, 20.87777 for the minrShoveTree and 18.34159 for the T tree, but then they diverge after that. The 100th iteration of the minrShoveTree gives me an SB average EV of 20.2619 and BB average EV of 20.2733 which add clearly above 40 like they should, and likewise for the T tree.

Any clue what could be causing this, I have gone back over the code more times than I would like to admit. Thanks
Will Tipton Video Pack 2 - Solving Poker Quote
08-21-2014 , 12:06 AM
Quote:
Originally Posted by MrPete
Quote:
Fix one player's strategy and calculate the other guy's max expl EV vs it. Then pick one hand combo to focus on, check it's EV at each decision point, and verify those EVs with manual calculation.
Unfortunately this is beyond my level of understanding the code (I've tried). If anyone could help get me started on doing this is would be greatly appreciated.
Quote:
Originally Posted by tagWAG
As a beginner at programming, I'd also be grateful for some help on this.

In particular, what is the best way to adapt our code so that we can fix one player's strategy and calculate the the other guy's max expl EV vs it.

Thanks
Well, I feel like composing ranges into strategies and then finding max expl counter strategies was like half of the video series , so you might want to re-watch some sections if you want details. That said, assuming everything is coded up right, the cliffnotes version looks something like:

1. make a strategy pair (remember this is basically a set of ranges -- one for each player for every spot in the game)

Code:
strats = StrategyPair(tree, sbStartingRange, bbStartingRange)
Remember by default, we set it up so that the players would start at the top of the tree with the starting ranges given and then split their ranges by essentially playing each hand randomly/uniformly at each decision point. But if you want to change a range, you can essentially do something like:

Code:
myNewRange = Range()
myNewRange.setRangeString("AKo,33,QJs", 1.0)
strats.ranges[index] = myNewRange
Here, index is an integer which is the number of the range you want to change. (The numbers for each action are printed on the decision tree.) Of course, if you change one range, you'll have to change others too -- you have to play all the hands you arrive at any decision point with some way, and you can't play any you don't get there with.

2. call setMaxExplEVs

If you wanna find SB's max expl EVs vs BB's strat:

Code:
setMaxExplEVs(tree, strats, "SB", "BB")
If BB is hero, switch SB and BB.

3. look at the EVs

E.g., if you want to see the SB's EV with Qh9s (numerical representation: [10,46]) at decision point 3, then

Code:
print strats.evs["SB"][5][10][46]
Will Tipton Video Pack 2 - Solving Poker Quote
08-21-2014 , 12:08 AM
Quote:
Originally Posted by tmfs
Getting towards the end of the video series, and running into an issue. Have debugged for a long time and can't quite find the problem.

I have successfully programmed through running the Fictitious Play simulation of the large game tree (soln2) of the Details and Example video and am not receiving any errors, but I am receiving slightly, yet clearly wrong results. I also received wrong results in the minrshoveTree equilibrium solution.

Up to running the minrShoveTree equilibrium all of my results have been exactly correct. One interesting occurrence is that the first SB average EV in both simulations is exactly correct, 20.87777 for the minrShoveTree and 18.34159 for the T tree, but then they diverge after that. The 100th iteration of the minrShoveTree gives me an SB average EV of 20.2619 and BB average EV of 20.2733 which add clearly above 40 like they should, and likewise for the T tree.

Any clue what could be causing this, I have gone back over the code more times than I would like to admit. Thanks
First of all, check out the errata. It seems from your numbers that you might be affected by the last one in particular. And keep in mind that if you were affected by that bug when you generated your equity arrays, you need to delete and re-generate them after fixing it. But none of them should cause the behavior you describe.

I suggest that you check your EV calcs as I describe in the previous post. However, if you get the first SB avg EV right, it indicates that a later step is more likely at fault: finding the max expl strategy from the max expl EVs or the mixing of ranges. So, look at each of those steps individually, too. Following from the code above, get the SB's max expl strat with:
Code:
sbMaxEVStrat = getMaxEVStrat(tree, "SB", strats)
and then look at the ranges and verify they're correct. If no luck, call updateRanges manually and check the mixing:
Code:
strats.updateRange("SB", sbMaxEVStrat, 1)
Will Tipton Video Pack 2 - Solving Poker Quote
08-21-2014 , 11:58 AM
Quote:
Originally Posted by yaqh
First of all, check out the errata. It seems from your numbers that you might be affected by the last one in particular. And keep in mind that if you were affected by that bug when you generated your equity arrays, you need to delete and re-generate them after fixing it. But none of them should cause the behavior you describe.

I suggest that you check your EV calcs as I describe in the previous post. However, if you get the first SB avg EV right, it indicates that a later step is more likely at fault: finding the max expl strategy from the max expl EVs or the mixing of ranges. So, look at each of those steps individually, too. Following from the code above, get the SB's max expl strat with:
Code:
sbMaxEVStrat = getMaxEVStrat(tree, "SB", strats)
and then look at the ranges and verify they're correct. If no luck, call updateRanges manually and check the mixing:
Code:
strats.updateRange("SB", sbMaxEVStrat, 1)
Thanks Will,

I believe I found the error,

Code:
           getMaxEVStratHelper(tree, hero, stratpair, iChild, result[iChild], result)
    else: # if this is not a hero decision point
        for iChild in tree.children[iCurrDecPt]:
            getMaxEVStratHelper(tree, hero, stratpair, iChild, currRange, result)
In the first getMaxEVStratHelper I had currRange instead of result[iChild]. I had to go over that at least 5 times and didn't catch it.

I feel like I'm getting close to completely understanding the video series, as it's my first major foray in computer programming, and looking forward to seeing everything that can be done with it. Thanks for the quality video series and the help in this thread.
Will Tipton Video Pack 2 - Solving Poker Quote
08-21-2014 , 06:22 PM
Quote:
Originally Posted by yaqh
Is that ten thousand? Those are the effective stacks behind at the beginning of the hand or at the beginning of the river? What's the river pot size? But yea, seems like a very limited number of actions.

Yes, S = 10000, but I think it should be indifferent as the money never gets in in my scenario. Pot at start of the river is 2650, SB can only bet 1400 and BB can reraise to 4050 and thats it


How are you calculating the EV? You're right that the players' EVs in any spot should sum to the total amount of chips in play, but if you're using the getAvgEVs function we wrote, some card removal effects make it not quite right when used at any decision points except for the beginning of the hand. I talked about this in the video. You can correct for those effects with a bit more work, though.

Yes, I´m using the getAvgEV. To be honest watched lots of parts of the videos at 2x speed as I also studied computer science and had experience with python so most of the videos were to slow for me (perfect for newbies as its supposed to be, I must say). Probably have missed the card ramoval effects in that function. Will review the video and fix the function.

If I have success, I should get a close to zero result in that scenario right?

Thanks again
Will Tipton Video Pack 2 - Solving Poker Quote
08-21-2014 , 07:35 PM
http://forumserver.twoplustwo.com/15...-game-1408420/

Thnx Will, very interesting post.
Did you use this for volume II or complete flop simulation?
Will Tipton Video Pack 2 - Solving Poker Quote
08-22-2014 , 12:37 PM
Hi,
thanks for taking the time to answer questions till now. I appreciate that.

Till now, I reduced required harddisk resources, I reduced required RAM resources and I reduced execution time.
And such, I would be interested into a simple benchmark; ie you running 300 iterations solving the turn tree with the code in the vid pack and then again with your optimized code.
I would be interested into %reduction of execution time so I have a bit of idea to which extent making the code faster is certainly doable as you have already done it.
Will Tipton Video Pack 2 - Solving Poker Quote
08-22-2014 , 11:58 PM
Hey Will,

I'd like to know if you feel the generation of flops in the linked thread below is solid for what you wanted out of it? I have been struggling with finding ways to drastically limit the amount of flops i need to work through, and the thread you created below seems really interesting to me, and i'm surprised at the lack of action it generated.

Quote:
Originally Posted by X0RR0
http://forumserver.twoplustwo.com/15...-game-1408420/

Thnx Will, very interesting post.
Did you use this for volume II or complete flop simulation?
Will Tipton Video Pack 2 - Solving Poker Quote
08-23-2014 , 01:18 PM
Hey Will, first of all I wanne say the book and the videos are great.

After completing the videoseries, I'm now trying to write my own c++ program as well. What I don't quite understand. Can I use pokereval with c++ on windows? What do I need for it? All I found was this
https://github.com/v2k/poker-eval
and I really don't understand what to do with all those files.
What are you using in your c++ program, if you don't mind me asking?

Oh and while I'm already asking. Is there anything faster than to work with simple arrays or vectors? Are they alike speedwise to the numpy-arrays?

Thanks.
Will Tipton Video Pack 2 - Solving Poker Quote
08-25-2014 , 11:42 AM
So I'm now getting ranges that identical to the ones posted by other for the large tree. However, my average ev's are wrong both for the minrShoveTree and the large tree. For the minrShoveTree, my initial average ev's are different to yours, and tend to deviate further away from equilibrium. i.e both numbers get slightly smaller with more trials.
Will Tipton Video Pack 2 - Solving Poker Quote
08-26-2014 , 04:55 PM
First of all: posting as someone else then post above, don't have a 2+2 account. But thanks for your fforts in this thread

My Question:

i'm currently watching video 7 and near the end of it i get the following error i don't quite understand. Any1 able to identify my mistake?

Will Tipton Video Pack 2 - Solving Poker Quote
08-26-2014 , 08:08 PM
Yes you miss parenthesis after the second getFilename... () which is a function.
The way to find the error is likewise : python tells you there is an error in this function. But this same function is called without error the line just before which is usually impossible if the arguments passed have not evolved, hence a problem with the arguments, which are in fact not passed at all.
For the second error, as you describe the hand with strings, I guess you want to use the function string2card.

Last edited by X0RR0; 08-26-2014 at 08:21 PM.
Will Tipton Video Pack 2 - Solving Poker Quote
08-26-2014 , 10:44 PM
Working through the 5 questions at the end of the Details and Example video, and it's probably somewhere, although I am unable to find it. What's the best method to find the EV at each index. soln2.evs[player][index] gives me an array, but I'm having a difficult time deciphering it.

Also, is there a way to list each hand, with the corresponding EV at each specific decision tree?
Will Tipton Video Pack 2 - Solving Poker Quote
08-27-2014 , 11:49 AM
I remember it is explained in the video, from memory it is:

soln2.evs[player][index][hand]
or for a specific hand:
soln2.evs[player][index][pe.string2card('Ac')][pe.string2card('2s')], be careful to respect the order of colors.
Will Tipton Video Pack 2 - Solving Poker Quote
08-27-2014 , 01:04 PM
Quote:
Originally Posted by X0RR0
I remember it is explained in the video, from memory it is:

soln2.evs[player][index][hand]
or for a specific hand:
soln2.evs[player][index][pe.string2card('Ac')][pe.string2card('2s')], be careful to respect the order of colors.

That's correct for a single hand which was clearly done in the videos, but I was looking for the EV for the entire range for each player at a specific Index. Say after the backdoor flush comes/or doesn't come in you would need to see the each players complete EV to compare who it benefits the most.

For example when I type in soln2.evs['BB'][21] I get this output, and it doesn't make very much sense:

array([[ 0. , -6.50162106, 13.07313899, ..., -1. ,
20.96047938, 23.90847809],
[ 0. , 0. , -5.51470433, ..., -1. ,
-4.88815789, -5.43427551],
[ 0. , 0. , 0. , ..., -1. ,
13.86718474, 13.65036881],
...,
[ 0. , 0. , 0. , ..., 0. ,
-1. , -1. ],
[ 0. , 0. , 0. , ..., 0. ,
0. , 24.397463 ],
[ 0. , 0. , 0. , ..., 0. ,
0. , 0. ]])

And for listing out each hand and their specific EV's at a certain Index i'm thinking I will have to write my own function for that.
Will Tipton Video Pack 2 - Solving Poker Quote
08-27-2014 , 04:13 PM
Quote:
Originally Posted by tmfs

Also, is there a way to list each hand, with the corresponding EV at each specific decision tree?
I'd be keen to know how to list hands like this, too.

Also, is there an easy way to output a list of how many combos of each hand there are in a range? It can be hard to tell this just from the hand range graphs alone.
Will Tipton Video Pack 2 - Solving Poker Quote
08-28-2014 , 01:36 PM
Quote:
Originally Posted by tmfs
...but I was looking for the EV for the entire range for each player at a specific Index. Say after the backdoor flush comes/or doesn't come in you would need to see the each players complete EV to compare who it benefits the most.

For example when I type in soln2.evs['BB'][21] I get this output, and it doesn't make very much sense:

And for listing out each hand and their specific EV's at a certain Index i'm thinking I will have to write my own function for that.
This is why we wrote the function:
# Inputs: strats, a StrategyPair
# player
# index: the number of an action (index is 0 at top of tree)
# Output: average ev over all hands, of player at index using strats
getAvgEVs(soln2,'BB',21)
Will Tipton Video Pack 2 - Solving Poker Quote

      
m