Poker-AI.org

Poker AI and Botting Discussion Forum
It is currently Mon Nov 13, 2023 12:28 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Simple questions
PostPosted: Sat Jan 09, 2016 6:11 pm 
Offline
Junior Member

Joined: Thu Feb 19, 2015 3:06 pm
Posts: 11
Location: Argentina
Hello, i have some doubts(?) about Weighting the enumerations..

first of all.. the weight table is used when is calculated the potential and strength of the hand, right?.. then

Code:
 if(ourrank>opprank){
    ahead += weightTable[i];
 }
 else if(ourrank==opprank){
    tied += weightTable[i];
 }
 total += weightTable[i];
 ...               
 strength = (ahead+tied/2)/total;


is this code right? or "total += weightTable[i]" should be "total += 1"

second..
According to Davidson paper:

Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }
}

"The relative value for each hand is increased or decreased to be consistent with every opponent action."

i can't see the way of increase the value with WT[E] = WT[E] * PT[A], if WT[E] is between 0 to 1, and in each street is mutiplied by other value between 0 to 1... how this work?

Thanks


Top
 Profile  
 
 Post subject: Re: Simple questions
PostPosted: Sun Jan 10, 2016 3:37 pm 
Offline
Site Admin
User avatar

Joined: Sun Feb 24, 2013 9:39 pm
Posts: 642
karma wrote:
Hello, i have some doubts(?) about Weighting the enumerations..

first of all.. the weight table is used when is calculated the potential and strength of the hand, right?.. then

Code:
 if(ourrank>opprank){
    ahead += weightTable[i];
 }
 else if(ourrank==opprank){
    tied += weightTable[i];
 }
 total += weightTable[i];
 ...               
 strength = (ahead+tied/2)/total;


is this code right? or "total += weightTable[i]" should be "total += 1"

If you believe opponent holds a uniformly distributed hand then every weightTable[i] is the same and could be 1. If you believe opponent is more likely to hold some cards than others then some weightTable[i] are greater than others.

karma wrote:
second..
According to Davidson paper:

Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }
}

"The relative value for each hand is increased or decreased to be consistent with every opponent action."

i can't see the way of increase the value with WT[E] = WT[E] * PT[A], if WT[E] is between 0 to 1, and in each street is mutiplied by other value between 0 to 1... how this work?

Thanks

To get the correct probabilities you would just normalise WT. As it is the the relative values of WT are correct.


Top
 Profile  
 
 Post subject: Re: Simple questions
PostPosted: Sun Jan 10, 2016 5:35 pm 
Offline
Junior Member

Joined: Thu Feb 19, 2015 3:06 pm
Posts: 11
Location: Argentina
spears wrote:
If you believe opponent holds a uniformly distributed hand then every weightTable[i] is the same and could be 1. If you believe opponent is more likely to hold some cards than others then some weightTable[i] are greater than others.

Yes, I understand it, I do this thinking that is more likely to hold some cards than others, my question is more stupid, for example:
weightTable lenght = 3.. I lost (with 0.50 prob. hold it), won (with 0.75 prob. hold it) and tie (with 0.25 prob. hold it)..
then is..
strength = (0.75+0.25/2) / (0.50+0.75+0.25)
or
strength = (0.75+0.25/2) / (1+1+1)
??

spears wrote:
To get the correct probabilities you would just normalise WT. As it is the the relative values of WT are correct.

Then for example.. if opp hold 72 preflop and call a raise, WT[72] was equal to 1, becomes 0.1.. in flop 725, opp raise, then.. WT[72] = 0.1 * 0.9 = 0.09 ??

Thanks so much


Top
 Profile  
 
 Post subject: Re: Simple questions
PostPosted: Sun Jan 10, 2016 6:11 pm 
Offline
Site Admin
User avatar

Joined: Sun Feb 24, 2013 9:39 pm
Posts: 642
Consider a toy game where both players can hold only A, K, Q or J.
- Hero holds K.
- Villain's weight table is {0.15, 0.5, 0.25, 0.1}.
- Hero's strength = (0.5/2 + 0.25 + 0.1) / (0.15 + 0.5 + 0.25 + 0.1)


Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }


     /* Normalise WT */
     TotalWeight = 0
     for each (E in WT) {
         TotalWeight = TotalWeight + WT[E]
     }
     for each (E in WT) {
         WT[E] = WT[E] / TotalWeight
     }
}


Top
 Profile  
 
 Post subject: Re: Simple questions
PostPosted: Sun Jan 10, 2016 7:06 pm 
Offline
Junior Member

Joined: Thu Feb 19, 2015 3:06 pm
Posts: 11
Location: Argentina
thank you, i still confused with the updated method.. for me is more logic this..
Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = (WT[E] + PT[A]) / 2
     }

}

I will continue reading.. thanks

It is hard but i love this, all about AI in general, I hope I can contribute in the future


Top
 Profile  
 
 Post subject: Re: Simple questions
PostPosted: Sun Jan 10, 2016 10:24 pm 
Offline
Site Admin
User avatar

Joined: Sun Feb 24, 2013 9:39 pm
Posts: 642
Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = (WT[E] + PT[A]) / 2
     }

}
E WT[E]old  PT[Raise]  WT[E]new
--------------------------------
A    0.25       1.0         0.625
K    0.25       1.0         0.625
Q    0.25        0.0        0.125
J    0.25         0.0        0.125
---------------------------------------
                              1.5 ????


The following is just Bayes Theorem. https://en.wikipedia.org/wiki/Bayes%27_theorem
probability of villain holding ace given action is raise = probability of action is raise given villain is holding ace * probability of villain holding ace / probability of action is raise

Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }


     /* Normalise WT */
     TotalWeight = 0
     for each (E in WT) {
         TotalWeight = TotalWeight + WT[E]
     }
     for each (E in WT) {
         WT[E] = WT[E] / TotalWeight
     }
}

E WT[E]old  PT[Raise]  WT[E]new
--------------------------------
A    0.25       1.0         0.5
K    0.25        1.0        0.5
Q    0.25        0.0        0.0
J    0.25         0.0        0.0
--------------------------------------
                              1.0


Top
 Profile  
 
 Post subject: Re: Simple questions
PostPosted: Mon Jan 11, 2016 12:59 am 
Offline
New Member

Joined: Tue Sep 29, 2015 5:56 pm
Posts: 9
karma wrote:
Hello, i have some doubts(?) about Weighting the enumerations..

first of all.. the weight table is used when is calculated the potential and strength of the hand, right?.. then

Code:
 if(ourrank>opprank){
    ahead += weightTable[i];
 }
 else if(ourrank==opprank){
    tied += weightTable[i];
 }
 total += weightTable[i];
 ...               
 strength = (ahead+tied/2)/total;


is this code right? or "total += weightTable[i]" should be "total += 1"

Yes, that code looks right, and "total += 1" looks wrong.

karma wrote:
second..
According to Davidson paper:

Code:
UpdateWeightTable(Action A, WeightTable WT, GameContext GC, OpponentModel OM)
{
     for each (entry E in WT)
     {
          ProbabilityDistribution PT[FOLD,CALL,RAISE]
          PT = PredictOpponentAction(OM, E, GC)
          WT[E] = WT[E] * PT[A]
     }
}

"The relative value for each hand is increased or decreased to be consistent with every opponent action."

i can't see the way of increase the value with WT[E] = WT[E] * PT[A], if WT[E] is between 0 to 1, and in each street is mutiplied by other value between 0 to 1... how this work?

Thanks


With that algorithm, you are right, WT[x] will only decrease. But the word "relative" is crucial here.

Example: suppose there are only two cards, Ace and King, and initially WT[K] = 0.5, WT[A] = 0.5. And suppose that the opponent calls, and the opponent model says that PT[call] for Ace is 40%, PT[call] for King is 80%, so now WT[A] = 0.5*0.4 = 0.2, WT[K] = 0.5*0.8 = 0.4. The probability that the opponent has ace is 0.2/(0.2+0.4) = 33%, king: 0.4/(0.2+0.4) = 67%. And if we have an ace (supposing ace is better than king), then with your strength computation algorithm, total becomes 0.4+0.2 = 0.6, ahead = WT[K] = 0.4, tied = WT[A] = 0.2 so strength = (ahead+tied/2)/total = (0.4+0.2/2)/0.6 = 83%.


Top
 Profile  
 
 Post subject: Re: Simple questions
PostPosted: Mon Jan 11, 2016 1:19 am 
Offline
Junior Member

Joined: Thu Feb 19, 2015 3:06 pm
Posts: 11
Location: Argentina
aaaaah, i now understand, especially the meaning of normalise :mrgreen: ...
Thank you so much :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group