New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Information Tensor for Universal Poker/ACPC is abstracted even when the game is fullgame #1033
Comments
Thanks for highlighting this. Solution 1 sounds like the way to go. There's no hard rule that the tensors should contain only 0s and 1s, though if possible it's preferred as it's a more natural input representation for neural networks. In the case of no limit poker I agree the most straightforward solution is to include the full bet size. I think it would make sense to keep the fold, call, raise, all-in 2-bit notation that you have surrounded with **, and then add another entry with the full bet size. WDYT? |
That sounds good to me. While we're on the topic, I also noticed that the InformationStateTensor just lists all actions from all rounds, in order. An alternative, which requires more space, but seems more natural, is to have different sections of the tensor for different rounds. Actually, some parts of the code hint that this was planned at some point: Line 361:
Line 424:
A notable benefit is that an action at a specific spot in the tensor will always belong to the same player. I would guess that this makes it much easier for neural nets to understand the infostate, so I'd propose switching to that. What do you think? |
I agree that this is more interpretable, but how much extra space does this require? If you're playing with 100bb you could imagine a pathological min-raise situation where player1 raises to 2bb, player2 to 3bb, player1 to 4bb etc... Is there a max raises per round parameter? (It's been a long time since I looked at this poker code) |
The current implementation requires O(max_actions_per_game) space. The proposed implementation would require O(num_rounds * max_actions_per_game) space. So if there are two betting rounds (preflop and postflop), then this would use 2x the space:
where "action So with the 100bb, the current implementation would require a tensor of length O(100) anyways, and the proposal would require O(200) with 2 betting rounds or O(400) with 4 betting rounds. If users of the library are in a situation where they need small tensors, they can still edit the OpenSpiel code back to what it is now, or they can take the tensor, remove blank spaces, and stitch it back together. I'm curious now to see how true my guess is (i.e. "it's easier for neural nets to understand the infostate" ), so I may run some empirical tests.
Yes, there is. By default it's maxint. |
Thanks for clarifying, I agree with all of the above, and I'm also curious to see if it's easier for neural nets to understand the infostate this way. In either case, natural and intuitive structuring of the infostate tensor is important for us humans as it's an easy entry point for subtle bugs to slip in. These changes would be a welcome contribution :) |
Thanks, guys. Just linking the submitted PR for completion: #1035 |
^ whoops, sorry for the confusion. #1035 isn't the issue discussed here, but contains a couple small related fixes. |
Oops :) |
Hi @VitamintK, just checking: did you ever submit a fix for this? |
No, not yet 😬 I ran those experiments and have the fix partially done, but haven't gotten around to finishing the PR yet! |
Hi @VitamintK, Just curious if you still have that code lying around and if you'd still be up for providing a PR fix for this, or if you'd even be willing to send us the relevant parts. It'd be great to finally fix the known issues in the poker implementation. |
I noticed that the information tensor for Universal Poker works when the game is abstracted, but when the game is unabstracted (i.e. full game) the information tensor is still abstracted, and it doesn't differentiate between different bet sizes.
outputs (stars around the relevant part):
Solutions: (1) properly implement a full infostate tensor for the unabstracted game, (2) print a warning about this issue to stderr when instantiating an unabstracted game or when getting an InformationStateTensor() from one, or (3) add a code comment to
universal_poker.h
about this issue.I think (1) would be the best solution and should be feasible. Should tensors in openspiel only contain 0s and 1s? If not, the infostate tensor for poker could be succinctly and elegantly represented with integers for bet sizes.
The text was updated successfully, but these errors were encountered: