open_spiel icon indicating copy to clipboard operation
open_spiel copied to clipboard

Information Tensor for Universal Poker/ACPC is abstracted even when the game is fullgame

Open VitamintK opened this issue 1 year ago • 11 comments

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.

game = pyspiel.load_game('universal_poker', {'bettingAbstraction': 'fullgame', 'numRanks':4, 'numSuits':1})
print(game.num_distinct_actions())
print('   check', game.new_initial_state().child(1).child(2).child(1).information_state_tensor())
print(' bet 400', game.new_initial_state().child(1).child(2).child(400).information_state_tensor())
print(' bet 500', game.new_initial_state().child(1).child(2).child(500).information_state_tensor())
print('bet 1200', game.new_initial_state().child(1).child(2).child(1200).information_state_tensor())

outputs (stars around the relevant part):

1201
   check [0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, **1.0, 0.0,** 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
 bet 400 [0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, **0.0, 1.0,** 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
 bet 500 [0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, **0.0, 1.0,** 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
bet 1200 [0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, **0.0, 1.0,** 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

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.

VitamintK avatar Mar 10 '23 16:03 VitamintK