TextWorld-Coin-Collector
April 7, 2021 · View on GitHub
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_collectorbranchpip 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 pytestpython -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.
- E.g.,
- You can use
scripts/check_for_duplicates.pyto 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.