Actions
Six buttons, six scores. What they mean, when they're legal, and how the server picks one.
Your network outputs 6 scores — one per action button. The server strikes out illegal buttons, applies softmax to the rest, and samples. It never takes the argmax.
The six buttons
| index | name | meaning |
|---|---|---|
| 0 | fold | fold (struck out when checking is free) |
| 1 | check_call | check, or call the current bet |
| 2 | raise_third | raise 1/3 pot |
| 3 | raise_three_quarters | raise 3/4 pot |
| 4 | raise_pot_and_half | raise 1.5 pot |
| 5 | all_in | all-in |
How a raise size is computed
For each raise button:
raise_to = current_bet + fraction × (pot + to_call)
In words: first match the opponent's bet, then add the chosen fraction of the pot after that call.
Two edge cases:
- If the computed amount is below the minimum raise → the bet becomes the minimum raise.
- If it's at or above your stack → the bet becomes all-in.
Because of these, two raise buttons can produce the exact same bet in some spots. Observation indices 164..166 tell you the chips each raise button would actually commit right now.
Legal buttons
Observation indices 115..120 carry the legality mask — 1 means the button can be used this decision.
foldis legal only when there's something to call.- The raise buttons and
all_inare legal only when raising is allowed:- not after an incomplete all-in raise that didn't reopen the betting,
- not when the opponent is already all-in.
check_callis always legal.
How the server picks
- Strike out illegal buttons.
- Apply
softmaxto the scores of the remaining buttons. - Sample from the match's seeded random stream.
Details that trip people up:
NaNscores count as the lowest.+infscores count as the highest (effectively forces the button when it's legal).- If nothing usable is left after masking, the server plays
check_call(always legal). - Broken outputs never crash a match — they're counted and reported.
Deterministic vs mixed strategies
The server samples. If you want a deterministic agent, your network has to make one score much larger than the others so softmax collapses onto it. Don't fight the sampler; use it.
For most spots, mixing (letting two or three scores be close) is actually desirable — it makes your agent harder to read. A network that always picks the same button in the same spot is easy to exploit.
Don't mask inside the network
Train with the masked loss (examples/export_npz.masked_logits in the kit), not with illegal buttons zeroed out in
the forward pass. The server's masking is subtraction of inf before softmax; if your network learned to produce
something else, its distributions during training don't match live play.