{"id":31108802,"url":"https://github.com/toybox-rs/Toybox","last_synced_at":"2025-09-17T06:46:01.299Z","repository":{"id":47203120,"uuid":"145441279","full_name":"toybox-rs/Toybox","owner":"toybox-rs","description":"The Machine Learning Toybox for testing the behavior of autonomous agents.","archived":false,"fork":false,"pushed_at":"2022-04-01T18:30:55.000Z","size":8029,"stargazers_count":27,"open_issues_count":35,"forks_count":12,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-08-25T19:42:19.893Z","etag":null,"topics":["atari","causality","explainable-ai","explanation","reinforcement-learning","xai"],"latest_commit_sha":null,"homepage":"http://toybox.rs","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toybox-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-20T16:10:46.000Z","updated_at":"2024-12-04T00:35:41.000Z","dependencies_parsed_at":"2022-09-06T05:01:43.362Z","dependency_job_id":null,"html_url":"https://github.com/toybox-rs/Toybox","commit_stats":null,"previous_names":["kdl-umass/toybox"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/toybox-rs/Toybox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toybox-rs%2FToybox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toybox-rs%2FToybox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toybox-rs%2FToybox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toybox-rs%2FToybox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toybox-rs","download_url":"https://codeload.github.com/toybox-rs/Toybox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toybox-rs%2FToybox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275549067,"owners_count":25484678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atari","causality","explainable-ai","explanation","reinforcement-learning","xai"],"created_at":"2025-09-17T06:45:25.352Z","updated_at":"2025-09-17T06:46:01.289Z","avatar_url":"https://github.com/toybox-rs.png","language":"Python","funding_links":[],"categories":["🚀 GitHub Repositories"],"sub_categories":["🎓 Educational \u0026 Tutorial Resources"],"readme":"# The Reinforcement Learning Toybox ![CI](https://github.com/toybox-rs/Toybox/workflows/CI/badge.svg)\n\nA set of games designed for testing deep RL agents. This repo contains Python wrappers and an intervention API for Toybox games. Python wrappers for the Atari games are constructed to mock the Arcade Learning Environment and subclass the gym.envs.atari.AtariEnv wrapper. [ToyboxBaseEnv](https://github.com/toybox-rs/Toybox/blob/main/toybox/envs/atari/base.py) may be a good entry point for the gym wrappers.\n\nIf you use this code, or otherwise are inspired by our white-box testing approach, please cite our [NeurIPS workshop paper](https://arxiv.org/abs/1812.02850):\n\n```\n@inproceedings{foley2018toybox,\n  title={{Toybox: Better Atari Environments for Testing Reinforcement Learning Agents}},\n  author={Foley, John and Tosch, Emma and Clary, Kaleigh and Jensen, David},\n  booktitle={{NeurIPS 2018 Workshop on Systems for ML}},\n  year={2018}\n}\n```\n\nWe have a lenghtier paper on [ArXiV](https://arxiv.org/pdf/1905.02825.pdf) and can provide a draft of a non-public paper on our acceptance testing framework by request (email at etosch at cs dot umass dot edu).\n\n## How accurate are your games?\n\n[Watch four minutes of agents playing each game](https://www.youtube.com/watch?v=spx_YQQW1Lw). Both ALE implementations and Toybox implementations have their idiosyncracies, but the core gameplay and concepts have been captured. Pull requests always welcome to improve fidelity.\n\n## Where is the actual Rust code?\n\nThe rust implementations of the games have moved to a different repository: [toybox-rs/toybox-rs](https://github.com/toybox-rs/toybox-rs)\n\n## Installation\n1. Create a virtual environment using your python3 installation: `${python} -m venv venv`\n   * **OSX** \n      * On OSX `${python}`, this is likely `python3`: thus, your command will be `python3 -m venv venv`\n      * If you are not sure of your version, run `python --version`\n   * **Windows** (_not fully tested!_)\n      * If you are on Windows, your command will likely be: `{python}`\n2. Activate your virtual environment:\n   * **BSD-ish**: `source venv/bin/activate`\n   * **Windows**: `venv/Scripts/activate`\n4. Install Toybox:\n\n```    \npip install ctoybox\npip install git+https://github.com/toybox-rs/Toybox\n```\n_Note: if you are trying to run from Windows, you will need to build from source. See instructions for [building](https://github.com/toybox-rs/toybox-rs/blob/main/docs/new-game-help.md) here._\n4. Install requirements: run `pip install -r REQUIREMENTS.txt`\n5. Run `python setup.py install`\n\n\n## Play the games (using pygame)\n\n    pip install ctoybox pygame\n    python -m ctoybox.human_play breakout\n    python -m ctoybox.human_play amidar\n    python -m ctoybox.human_play space_invaders\n\n## Run the tests\n\nSample behavioral tests developed with Toybox are frozen and [available here](https://github.com/toybox-rs/openai-baselines-envs). These tests are featured with an OpenAI baselines integration to facilitate off-the-shelf model training.\n\n\n## Python\n\nTensorflow, OpenAI Gym, OpenCV, and other libraries may or may not break with various Python versions. We have confirmed that the code in this repository will work with the following Python versions:\n\n* 3.6, 3.7\n\n## Get starting images for reference from ALE / atari_py\n\n`./scripts/utils/start_images --help` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoybox-rs%2FToybox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoybox-rs%2FToybox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoybox-rs%2FToybox/lists"}