Skip to content

xingdi-eric-yuan/TextWorld-Coin-Collector

Repository files navigation

TextWorld-Coin-Collector


PyTorch implementation of papar Counting to Explore and Generalize in Text-based Games

Coin Collector

  • Coin collector is a set of games, each game is a randomly connected chain of rooms, the agent's goal is to navigate through the path and pick up the coin.
  • Modes: easy / medium / hard, amount of off-chain rooms.
  • Levels: Length of optimal trajectory.
  • Action space: {go, take} × {north, south, east, west, coin}​
  • Environment ID: twcc_[mode]_level[level]_gamesize[#game]_step[max step]_seed[random seed]_[split], please check here for more details.

Requirements

  • Python 3
  • PyTorch 0.4
  • TextWorld: install the coin_collector branch
    • pip install https://github.com/microsoft/TextWorld/archive/refs/heads/coin_collector.zip
  • Install gym_textworld by pip install gym_textworld/.
  • tensorboardX
    • pip install tensorboardX
  • nltk + the punkt package:
    • pip install nltk pytest
    • python -c "import nltk; nltk.download('punkt')"

Game Generation

  • Run tw-make.py <env_id> to generate games corresponding to games defined in config files.
    • E.g., tw-make.py twcc_easy_level10_gamesize100_step50_seed9_train.
  • You can use scripts/check_for_duplicates.py to check duplicates between training and /test sets.

To Run

  • LSTM-DQN: run python lstm_dqn_baseline/train_single_generate_agent.py -c lstm_dqn_baseline/config/.
  • LSTM-DRQN: run python lstm_drqn_baseline/train_single_generate_agent.py -c lstm_drqn_baseline/config/.
  • Configurations can be modified in the above two config files.

LICENSE

MIT

References

About

Coin collector game in Microsoft TextWorld, and a simple RL agent solving it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages