ericgjackson / slumbot2019

Implementations of CFR for solving a variety of Holdem-like poker games
MIT License
133 stars 31 forks source link

BUG: MPTree doesnt work with holdem params #32

Closed huttarichard closed 1 year ago

huttarichard commented 1 year ago

Hi @ericgjackson,

I been studying a bit a slumbot, and I think I found a bug.

in README.md

../bin/build_hand_value_tree holdem_params
../bin/build_betting_tree holdem_params mb1b1_params 

when building betting tree Im getting illegal access, coming from:

void BettingTreeBuilder::Write(Node *node,
                               vector<vector<int>> *num_nonterminals,
                               Writer *writer) {
                               .....
  if (nt_first_seen) {
    id = (*num_nonterminals)[pa][st]++;
    node->SetNonterminalID(id);
  }

the variable of player acting, pa goes out of range of num_nonterminals.

Switching from:

root_ = CreateMPTree(target_player_, &terminal_id);
to:
root_ = CreateNoLimitTree1(target_player_, &terminal_id);

seems to fix the issue.

On separate note, could you tell us what parameters has been used for training slumbot online version? Im trying to replicate that work, to have local benchmark for deep learning research Im doing.

Im interested about betting/card abstraction, what amount of iterations?

Thank you very much.

ericgjackson commented 1 year ago

Hi, thanks for the bug report. I can't replicate the crash currently. Did you by any chance make any changes to holdem_params or mb1b1_params?

I'll try to respond in a bit to the second half of your question.

huttarichard commented 1 year ago

I dont think I did any change to params, but I can tried to replicate this on linux? Im currently running osx, also if you want I can push compatibility layer to make this work on osx. But It might be possible it is related to changes I made (there are few small ones, but nothing that should affect this).

I dig in deeper.

ericgjackson commented 1 year ago

I was thinking about the second part of your question, and, unfortunately, I think it would not really be feasible for you to train an equivalent of the version of Slumbot found on the website. For one thing, it might cost quite a bit. I don't recall exactly how much I spent, but I used one the largest instance types available on AWS for a month, I think, which isn't cheap. In addition, there is some custom logic (aka hacks) applied at runtime which you don't have access to currently and adds a fair amount of complexity.

Might be better to just build your own system to use as a baseline.

huttarichard commented 1 year ago

@ericgjackson thank you for reply. Understood.

If there is any chance we would be able to understand at least the card abstraction / betting abstraction that would be appreciated. I think i can guess the betting based on responses. But card abstraction, I dont think we can guess that.

Computing power is not exactly the issue :)

But thank you anyway. To be clear I think you deserve much more credit for this. Its amazing piece of work. Cheers.

ericgjackson commented 1 year ago

I did check in the betting abstraction params used for slumbot.com. It's in runs/nlt5_params.

The card abstraction params wouldn't be too useful without knowing how the buckets were generated. What I can say is that I used no abstraction for the preflop and flop and 8 million buckets for the turn. The river abstraction had either 11 million or 40 million buckets (kind of confusing, but I built two systems, one for player 1 and one for player 2, and each system used a different river card abstraction).