v2.0.0
API v2
Pgx has been updated from API v1 to v2 as of November 8, 2023 (release v2.0.0
). As a result, the signature for Env.step
has changed as follows:
- v1:
step(state: State, action: Array)
- v2:
step(state: State, action: Array, key: Optional[PRNGKey] = None)
Also, pgx.experimental.auto_reset
are changed to specify key
as the third argument.
Purpose of the update: In API v1, even in environments with stochastic state transitions, the state transitions were deterministic, determined by the _rng_key
inside the state
. This was intentional, with the aim of increasing reproducibility. However, when using planning algorithms in this environment, there is a risk that information about the underlying true randomness could "leak." To make it easier for users to conduct correct experiments, Env.step
has been changed to explicitly specify a key.
Impact of the update: Since the key
is optional, it is still possible to execute as env.step(state, action)
like API v1 in deterministic environments like Go and chess, so there is no impact on these games. As of v2.0.0
, only 2048, backgammon, and MinAtar suite are affected by this change.
What's Changed
- [Docs] Update 2048 version by @sotetsuk in #1036
- [Mahjong] Imprement
ryuukyoku
by @OkanoShinri in #1038 - [Mahjong] Imprement
ron
by @OkanoShinri in #1040 - Update leduc_holdem.md by @bleu48 in #1042
- [Mahjong] Imprement
tsumo
by @OkanoShinri in #1041 - [Mahjong] Convert to
json
format by @OkanoShinri in #1048 - [Backgammon] Add description to the playable_dice_count_vec by @nissymori in #1047
- [CI] Comment out some expensive tests as hotfix by @sotetsuk in #1052
- [Mahjong] Implement Menzen by @OkanoShinri in #1045
- [Mahjong] Determine
current_player
afterpass
by @OkanoShinri in #1053 - [Docs] Add license doc by @sotetsuk in #1057
- [Mahjong] Implement kandora by @OkanoShinri in #1054
- [Docs] Update citation by @sotetsuk in #1063
- [Docs] Add arXiv link by @sotetsuk in #1064
- [Mahjong] Dora-score calculation by @OkanoShinri in #1061
- [Test] Run CI with python3.10 only by @OkanoShinri in #1066
- [Colab] Update chess check by @sotetsuk in #1068
- [Mahjong] Add
mahjong
to Env by @OkanoShinri in #1069 - [Example] Add wandb link by @sotetsuk in #1072
- [Example] Use default Gumbel AlphaZero hyperparameters by @sotetsuk in #1055
- [API] Use
int32
instead ofint8/16
by @sotetsuk in #1074 - [Test] Remove redundant random play tests by @sotetsuk in #1076
- [Chess] Fix wrong zobrist hash by @sotetsuk in #1078
- [Experimental] Fix
act_randomly
API by @sotetsuk in #1077 - [2048] Fix bug in legal action mask by @sotetsuk in #1049
- [Mahjong] Remove old files by @sotetsuk in #1075
- [Backgammon] Update document by @sotetsuk in #1046
- [dataclass] Fix dataclass mutable defaults error by @carlosgmartin in #1067
- [dataclass] Suppress C901 by @sotetsuk in #1080
- [Mahjong] Add type annotations by @sotetsuk in #1081
- Add Python 3.11 CI by @sotetsuk in #997
- [CI] Add Python 3.12 to CI by @sotetsuk in #1082
- v2 API by @sotetsuk in #1058
- [Docs] Fix API document by @sotetsuk in #1083
- [Dependency] Update JAX version by @sotetsuk in #1084
- [Typing] Add
types.py
by @sotetsuk in #1085 - [dataclass] Trace Flax dataclass updates by @sotetsuk in #1086
- [Tidy] Add
requirements.txt
by @sotetsuk in #1087 - [experimental] Adjust
auto_reset
to v2 API by @sotetsuk in #1088 - [Mahjong] Add assets in release by @sotetsuk in #1089
- [MinAtar] Fix minatar usage by @sotetsuk in #1090
- [Backgammon, 2048] Update versions by @sotetsuk in #1092
- [Docs] v2 API description by @sotetsuk in #1091
- [Chess] Update version by @sotetsuk in #1093
- [2048] Update documents by @sotetsuk in #1094
- [Mahjong] Unregister mahjong due to large file size by @sotetsuk in #1095
New Contributors
- @bleu48 made their first contribution in #1042
- @carlosgmartin made their first contribution in #1067
Full Changelog: v1.4.0...v2.0.0