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

07-17-2014 , 06:53 PM
Quote:
Anyone who has read Expert Heads Up No Limit Holdem knows that there is tons to learn from solving model games and analyzing the GTO strategies that result. The ability to solve large poker games was directly responsible for many of the insights in EHUNL and set it apart from poker advice available elsewhere. Unfortunately, this sort of work involves large computations, and software to perform these calculations was not publicly accessible -- until now.

This video series will walk you through the development of computer code to solve for maximally exploitative and equilibrium strategies of arbitrary HUNL decision trees, to visualize the trees, and to investigate the resulting strategies and the EVs of playing them. You will learn to leverage the powerful but user-friendly iPython (interactive python) programming enviroment and create a tool that allows you to perform many of the calculations described in the books. Moreover, in learning how to build it rather than how to use a pre-existing software package, you will gain the understanding necessary to go beyond published work and to perform game theoretic studies of your own imagination. It's an exciting time to be a poker player.
Will Tipton Video Pack 2 - Solving Poker
Will Tipton Video Pack 2 - Solving Poker Quote
07-17-2014 , 06:57 PM
So in your last video in your video pack you showed ur own software "GameTreeVisualizer". I want to create something interactive like that as well later on and create a lot of models using this software and ur books. Did you use ipython as well to create that software in that 16th video when you are talking about GUI (graphical user interface)?
Will Tipton Video Pack 2 - Solving Poker Quote
07-17-2014 , 09:25 PM
Here is a suggestion to improve the visualization of ranges.

This applies to the 7th video where the Range class and its displaying method (_repr_svg_()) are defined.

This line of code:

hexcolor = '#%02x%02x%02x' % (255*(1-frac), 255, 255*(1-frac))

can be replaced by

hexcolor = '#%02x%02x%02x' % (255*(1-frac), 255*(1-(0.5*frac)), 255*(1-frac))

This makes the colors vary from white (255,255,255) to a darker shade of green (0,128,0) rather than pure green (0,255,0). This increases the contrast between combos that have similar frequencies (e.g. 100% and 75%) and makes mixed strategies more apparent, as will be seen in the solution of the shove/fold game.

Last edited by Sevendeuceo; 07-17-2014 at 09:30 PM.
Will Tipton Video Pack 2 - Solving Poker Quote
07-17-2014 , 10:09 PM
^ cool

Quote:
Originally Posted by minotaurs
So in your last video in your video pack you showed ur own software "GameTreeVisualizer". I want to create something interactive like that as well later on and create a lot of models using this software and ur books. Did you use ipython as well to create that software in that 16th video when you are talking about GUI (graphical user interface)?
Yea, I think a better GUI for exploring solutions is probably the most important "next step" after the video series if you want to study some larger games. Basic GUI programming isn't really hard, but it's sort of a big topic. As I mentioned in the last video, I'd recommend using the Qt framework. It's python versions are PyQt and PySide. The GameTreeVisualizer utility is written in C++ using Qt.

Random note: we added another free video yesterday (Video 9: the shove/fold game). It's about the halfway point of the series, and I wanted to provide one that shows some somewhat less introductory content.
Will Tipton Video Pack 2 - Solving Poker Quote
07-18-2014 , 03:19 AM
^ cool
Will Tipton Video Pack 2 - Solving Poker Quote
07-18-2014 , 05:23 AM
Do what Will does, not what he says!

I got an error the first time I tried to display a game tree, following instructions in the 9th video. iPython claimed not to be able to find the graphviz libraries.

The problem was a missing \bin\ at the end of the windows PATH variable. In the video, Will cuts the parent directory, without the "bin" sub-directory or the last slash, but since the correct path already had been set on his computer this did not cause any problem.

Anyway, don't forget to navigate to the bin sub-directory and also include the last "\" when you find the ...\Graphviz2.38\bin\ directory.

This will also be worthy on inclusion in an errata for the programming-semi-illiterates such as myself.

Last edited by Sevendeuceo; 07-18-2014 at 05:38 AM.
Will Tipton Video Pack 2 - Solving Poker Quote
07-18-2014 , 10:22 AM
Quote:
Originally Posted by Sevendeuceo
Do what Will does, not what he says!

I got an error the first time I tried to display a game tree, following instructions in the 9th video. iPython claimed not to be able to find the graphviz libraries.

The problem was a missing \bin\ at the end of the windows PATH variable. In the video, Will cuts the parent directory, without the "bin" sub-directory or the last slash, but since the correct path already had been set on his computer this did not cause any problem.

Anyway, don't forget to navigate to the bin sub-directory and also include the last "\" when you find the ...\Graphviz2.38\bin\ directory.

This will also be worthy on inclusion in an errata for the programming-semi-illiterates such as myself.
Tnx a lot for letting us know man
Will Tipton Video Pack 2 - Solving Poker Quote
07-18-2014 , 01:56 PM
Hey, after trying to plot equity distributions i saw that my graph looks different that the one Will gets in his video. Any ideas why its like that? (1st is Will's and 2nd is mine)

Will Tipton Video Pack 2 - Solving Poker Quote
07-18-2014 , 03:13 PM
Quote:
Originally Posted by minotaurs
Hey, after trying to plot equity distributions i saw that my graph looks different that the one Will gets in his video. Any ideas why its like that? (1st is Will's and 2nd is mine)

It looks like the range your inputting is wrong. Those sort of piece-wise steps make it seem like you only have a few hand combos in your range.
Will Tipton Video Pack 2 - Solving Poker Quote
07-18-2014 , 05:13 PM
Also turned out that my shove/fold game gave me all wrong resaults, but i was checking all over again Equity Array, Range Class, plotting equity distributions and also Shove Fold game codes all over again and they are all exactly like in the video. I dont see where the problem is. Here is my resauts of shove// fold game
Will Tipton Video Pack 2 - Solving Poker Quote
07-18-2014 , 09:04 PM
Quote:
Originally Posted by minotaurs
Also turned out that my shove/fold game gave me all wrong resaults, but i was checking all over again Equity Array, Range Class, plotting equity distributions and also Shove Fold game codes all over again and they are all exactly like in the video. I dont see where the problem is. [...]
I might be able to help if I can look at your code. Check the PM I sent you.
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 05:38 AM
Just so you know everything is cool. Sevendeuceo helped me and he spoted some wrong things in my code and for the 1st picture of equity distributions i just used other board
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 10:49 AM
Hi im having problem again. Its with Graph vizualization. When i wrote everything for minraise/shove game everything was fine but when i tryed to run
minrShoveTree all i got was this
Quote:
minrShoveTree
Out[124]: <__main__.Tree instance at 0x07AA6620>
When we created shove/fold game decision tree i got the resault. Any ideas why now im getting this?
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 11:47 AM
Quote:
Originally Posted by Sevendeuceo
Do what Will does, not what he says!

I got an error the first time I tried to display a game tree, following instructions in the 9th video. iPython claimed not to be able to find the graphviz libraries.

The problem was a missing \bin\ at the end of the windows PATH variable. In the video, Will cuts the parent directory, without the "bin" sub-directory or the last slash, but since the correct path already had been set on his computer this did not cause any problem.

Anyway, don't forget to navigate to the bin sub-directory and also include the last "\" when you find the ...\Graphviz2.38\bin\ directory.

This will also be worthy on inclusion in an errata for the programming-semi-illiterates such as myself.
Ah, thanks for letting me know. There is an errata at the husng.com page linked in OP, and I'll add a note about this there.
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 12:28 PM
Quote:
Originally Posted by minotaurs
Hi im having problem again. Its with Graph vizualization. When i wrote everything for minraise/shove game everything was fine but when i tryed to run
minrShoveTree all i got was this

When we created shove/fold game decision tree i got the resault. Any ideas why now im getting this?
Check out the Technical FAQ at the husng.com page linked to in OP.
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 01:08 PM
Quote:
Originally Posted by minotaurs
Just so you know everything is cool. Sevendeuceo helped me and he spoted some wrong things in my code and for the 1st picture of equity distributions i just used other board
Glad you guys got it figured out, thanks for letting me know. Some more thoughts on debugging when working through this video series --

Generally speaking, bugs are a part of programming. Thus, debugging is an unavoidable. If some of your code doesn't work while you're going through this video series, and you have to set out to fix it, please don't think of that as an unfortunate detour. On the contrary, it's an important and valuable part of the process. If you just copy down everything I write, and it works perfectly, you haven't gotten your money's worth .

So, I hope peoples' debugging process goes beyond comparing their code to that in the video. That isn't realistic, of course. When you write your own code, there won't be an answer key available, and you'll have to figure out problems on your own. If you get stuck when working through the video series, I'm happy to help, but try to provide as much relevant info as possible. There's only so much we can do with "My X doesn't work, and here's a picture of it not working." And if that's all the info you have, you likely haven't spent enough time trying to figure out the problem yourself.

To make this easier on everyone involved, I ask that people who want help debugging adopt a particular procedure. Let me explain --

Generally, debugging will happen when you have some assumptions about how the code should work, but the program doesn't do what you think it should. E.g. "My picture doesn't match the picture in the video." Please start there and work backwards to the source of the issue.

So, you have a function that's producing a wrong answer, and that function has some inputs. Google image search provides this helpful illustration, where I guess "I" is "Input":



As far as I can recall, for all functions we write in this video series, the output follows deterministically from the input. That is, if you run it a bunch of times with the same input, you'll get the same output every time. Our functions don't use random numbers or reach out over the network for data or anything like that. So, if the output is wrong, then either
  1. one of the inputs is wrong, or
  2. the logic in the function itself is wrong

Test each of those cases, starting with the inputs. For each input to the function: figure out what you think it should look like, and then check what it actually is when you run the program. Print statements are helpful for this. If all the inputs are correct, then it's the function itself that is at fault. Otherwise, if one of the inputs is bad, move to the place where that input is being generated and repeat the process. This process should narrow down the problem to a a particular function.

So, please provide all of the following info (in a nicely formatted way) if you need debugging help:
  1. What function is giving a wrong answer, what is that answer, and what should the answer be?
  2. For all inputs to the function:
    1. what should the input be?
    2. what is the input when you actually run the code?
  3. If all the inputs are correct, then presumably the problem is in the current function. Please provide your code for that function.
  4. If one of the inputs was not correct, then move to the function that produced that input and go back to 1.

Finally, once we do solve the issue, it'd be great if an explanation were recorded in this thread in case other people have the same problem.
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 01:43 PM
Yes my functions name was wrong it was _repr_png instead of _repr_png_ so tnx for help
But now im having new problem again
Look what i got as result

Any hints where should i look? I think i have looked at everything but of course as we see i didnt. And sry for all the questions
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 01:48 PM
^ Glad you found the issue with _repr_png_. For the new issue, please try following the procedure in post #16.
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 05:24 PM
I still have nothing. Its about this :

Quote:
What function is giving a wrong answer, what is that answer, and what should the answer be?
Basically as we can see the decision points are all created
I printed out all parents and childrens information and its all correct so addDecPt function is working like it should as well as getNumPoints()
print(minrShoveTree.children)
print(minrShoveTree.parents)
print(minrShoveTree.getNumPoints())
[[1, 2], [], [3, 4], [], [5, 6], [], []]
[None, 0, 0, 2, 2, 4, 4]
7

So the only thing wht is left is _repr_png_(self): function which should return that png picture but not like mine
Here are all the decision points so looks like there is no problem
Quote:
S = 20
preflopEArray = EquityArray(pe.string2card(['__', '__', '__', '__', '__']))
point0 = DecPt('SB', 0.5, 1, preflopEArray, "")
point1 = DecPt('Leaf', 0.5, 1, preflopEArray, "Fold")
point2 = DecPt('BB', 2, 1, preflopEArray, "bet")
point3 = DecPt('Leaf', 2, 1, preflopEArray, "fold")
point4 = DecPt('SB', 2, 20, preflopEArray, "bet")
point5 = DecPt('Leaf', 2, 20, preflopEArray, "fold")
point6 = DecPt('Leaf', 20, 20, preflopEArray, "call")

minrShoveTree = Tree(S, point0)
minrShoveTree.addDecPt(point1,point0)
minrShoveTree.addDecPt(point2,point0)
minrShoveTree.addDecPt(point3,point2)
minrShoveTree.addDecPt(point4,point2)
minrShoveTree.addDecPt(point5,point4)
minrShoveTree.addDecPt(point6,point4)
So the problem must be in here _repr_png_(self):
Code:
    def _repr_png_(self):
        g = pydot.Dot(graph_type="digraph")
        for i in range(self.getNumPoints()):
            #str() converts number in str into the string
            node_label = str(i) + ': ' +self.decPts[i].player \
                         + ' (' + str(self.decPts[i].initial_sb_cip) + ',' \
                         + str(self.decPts[i].initial_bb_cip) + ')'
            g.add_node(pydot.Node('node%d'%i, label=node_label))   #%d will be replaced with value of %i
             
        for i in range(self.getNumPoints()):
            for j in self.children[i]:
                g.add_edge(pydot.Edge('node%d'%i, 'node%d'%j, label=self.decPts[j].parentAction))
            return g.create(g.prog, 'png')
I just dont understand why it made 1st part of the tree OK.


LOL I KNEW THERE WILL BE SOMETHING SILLY ABOUT THIS. THE PROBLEM WAS THIS:
Code:
    def _repr_png_(self):
        g = pydot.Dot(graph_type="digraph")
        for i in range(self.getNumPoints()):
            #str() converts number in str into the string
            node_label = str(i) + ': ' +self.decPts[i].player \
                         + ' (' + str(self.decPts[i].initial_sb_cip) + ',' \
                         + str(self.decPts[i].initial_bb_cip) + ')'
            g.add_node(pydot.Node('node%d'%i, label=node_label))   #%d will be replaced with value of %i
             
        for i in range(self.getNumPoints()):
            for j in self.children[i]:
                g.add_edge(pydot.Edge('node%d'%i, 'node%d'%j, label=self.decPts[j].parentAction))
       |<----return g.create(g.prog, 'png')  <------- THIS LINE SHOULD HAVE BEEN THERE
GJ TO ME FOR SPOTTING THIS ONLY AFTER 5 HOURS OR SO...

Last edited by minotaurs; 07-19-2014 at 05:31 PM.
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 05:45 PM
Yup, spacing matters in python. Great work narrowing down and finding the problem!
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 07:14 PM
I have a question from a couple days ago I forgot to ask. I get a different result for the big tree with the turn/river spot than you do in the video and I think the result I get makes more sense (I didn't make any intentional changes to the code.)

Specifically here are the EV's (sb/bb, those from the video first) from the first couple runs of the FP, and the 55/56th runs (I didn't want to wait for all 300 as I had to rerun mine but the problem does persist):

Run 1: 18.34/20.13 --- 19.97/22.72
Run 2: 18.49/20.25 --- 19.72/22.26
Run 55: 18.30/20.92 --- 19.09/21.07
Run 56: 18.30/20.93 --- 19.08/21.07

So first the #s are obviously different, but more importantly those in the video seem to be converging somewhere close to 39bb (after 300 iterations it's at 18.30/21.03) whereas mine is converging somewhere close to 40bb. Since stacks are 40bb, that number should converge to 40bb right?

Also, something I just noticed while writing this is that in the video the EV of the max exploit strat for the bb is actually increasing as the FP runs, that doesn't seem right either?

I wasn't able to find the discrepancy between the code I have (which I obviously just copied from the video) and that from the video, but wanted to confirm that something is wrong with the video's (or my) results.
Will Tipton Video Pack 2 - Solving Poker Quote
07-19-2014 , 08:58 PM
I just got into programming and i'm having loads of fun with it. I'm also a huge fan of your work, and have read about 1/2 of your first book (and i own the 2nd too).

1) Would this video-pac be suitable for me? Or do i need more programming experience (i have only been coding for 2 weeks) or do i need to have read both books (as i said, i own both copies)?

2) Will it also be beneficial to my very limited programming experience?
Will Tipton Video Pack 2 - Solving Poker Quote
07-20-2014 , 03:35 AM
Quote:
Originally Posted by Carlton Banks
I just got into programming and i'm having loads of fun with it. I'm also a huge fan of your work, and have read about 1/2 of your first book (and i own the 2nd too).

1) Would this video-pac be suitable for me? Or do i need more programming experience (i have only been coding for 2 weeks) or do i need to have read both books (as i said, i own both copies)?

2) Will it also be beneficial to my very limited programming experience?
When you read the book futher u wil see that u need some computer help to do more complex calculations and if you are having fun already with programming i would say go for it.
I myself havent finished reading the 2nd book yet but i figured that ill go through this video pack 1st to make core of this program and than as i continue to read 2nd book ill be able to add some stuff from book to that program.
As for the programming of course experience is good but u can only get it by doing stuff. And Will explains everything what hes doing so you will start to get the idea very fast how this IPython works (I know comes from the person who is the only 1 posting his problems here )
Will Tipton Video Pack 2 - Solving Poker Quote
07-20-2014 , 10:07 AM
Quote:
Originally Posted by Carlton Banks
I just got into programming and i'm having loads of fun with it. I'm also a huge fan of your work, and have read about 1/2 of your first book (and i own the 2nd too).

1) Would this video-pac be suitable for me? Or do i need more programming experience (i have only been coding for 2 weeks) or do i need to have read both books (as i said, i own both copies)?

2) Will it also be beneficial to my very limited programming experience?
View the four free sample videos (#1,#2,#3, and #9) available on the HUSNG web site. Some of the following videos are more challenging but not terribly so. They will get you started and give you a fair idea about what to expect.

Only the first two chapters of vol.1 are prerequisites. But the material finds application for ideas discussed across both volumes. And resources and tutorials for iPython programming are plentiful online.
Will Tipton Video Pack 2 - Solving Poker Quote
07-20-2014 , 11:37 PM
I did something! Solid blue line is EV, dashed blue line is if both players just turned over their hands and collected their equity in the pot with no betting, red line is capture factor for which I've used (solid blue line - player chips in pot) / (dashed blue line - player chips in pot). It's late and I don't have the book handy, I believe this is how it's defined the book? (although it's a bit awkward for a preflop situation I suppose)

Anyways, this one is for the minraise/jam game from the sb's perspective:


From the bb's perspective:


Does this look reasonable?

Last edited by stevepa; 07-20-2014 at 11:53 PM.
Will Tipton Video Pack 2 - Solving Poker Quote

      
m