-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUGFIX: Ensure puppeteer state is part of the PuppetPolicy state.
Certain puppeteer functions (e.g. `GrimTwoResourceInTheMatrix`) are not pure functions, but are `Callable` objects that maintain their own state between `__call__` and update it as a side-effect. This means that puppeteer state is not exposed in the `PuppetPolicy` state returned by `initial_state` and transformed by `step`. This causes undefined behavior in two ways: 1. Since puppeteer functions are shared between PuppetPolicy, multiple puppets running in the same Scenario will erroneously share a single puppeteer state between multiple puppets. 2. Puppeteer state is not reset at the start of a new episode. This change fixes this by ensuring that puppeteer state is a part of the `PuppetPolicy` state and is reset on `step_type.last()`. NOTE: This bug did not affect the experiments run in the Melting Pot paper. fixes #70 PiperOrigin-RevId: 469167894 Change-Id: Iaee2243f326ca9fdf0670d72596a5e92f12e3655
- Loading branch information
1 parent
6ff20fa
commit 7ee768f
Showing
4 changed files
with
103 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters