fix: correct ground_truth comparison in BanditEnv - #190
Conversation
`ground_truth` is a dict mapping button names to probabilities, but the final-turn check compared a button string directly against this dict (`button == self.state.game_state['ground_truth']`), which always evaluates to False. This means the player can never win. Fix: find the button with the highest probability first, then compare.
|
Ready to merge. Correctly diagnosed: |
|
Verified. LGTM, recommend merge. |
Summary
ground_truthinBanditEnvis a dict mapping button names to probabilities (e.g.{"red": 0.6, "blue": 0.3, ...}), but the final-turn winner check compares a button string directly against this dict (button == self.state.game_state['ground_truth']), which always evaluates toFalse.max(..., key=...), then compare the player's choice against that.Reproduction
Test plan
_regret()already correctly usesground_truthas a dict (calls.values()and indexes by button name), confirming this is a dict, not a string.