{"id":21300110,"url":"https://github.com/roclark/openai-gym-pytorch","last_synced_at":"2025-10-12T13:40:42.459Z","repository":{"id":38237257,"uuid":"200446375","full_name":"roclark/openai-gym-pytorch","owner":"roclark","description":"Examples of reinforcement learning using PyTorch to solve the OpenAI Gym problems","archived":false,"fork":false,"pushed_at":"2023-03-15T16:57:18.000Z","size":12850,"stargazers_count":16,"open_issues_count":7,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T15:06:56.984Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roclark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-04T03:47:12.000Z","updated_at":"2024-02-22T14:47:02.000Z","dependencies_parsed_at":"2023-02-11T08:30:23.661Z","dependency_job_id":null,"html_url":"https://github.com/roclark/openai-gym-pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roclark%2Fopenai-gym-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roclark%2Fopenai-gym-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roclark%2Fopenai-gym-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roclark%2Fopenai-gym-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roclark","download_url":"https://codeload.github.com/roclark/openai-gym-pytorch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225750111,"owners_count":17518315,"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","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":[],"created_at":"2024-11-21T15:07:30.766Z","updated_at":"2025-10-12T13:40:37.400Z","avatar_url":"https://github.com/roclark.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI Gym PyTorch\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"media/pongnoframeskip-v4.gif\"\u003e\n\u003c/p\u003e\n\nOpenAI's Gym is an open source toolkit containing several environments which can\nbe used to compare reinforcement learning algorithms and techniques in a\nconsistent and repeatable manner, easily allowing developers to benchmark their\nsolutions.\n\nThis repository aims to create a simple one-stop location for testing\nreinforcement learning models without worrying about configuring or maintaining\nthe environment. Featuring extensive command-line parameters, various tweaks to\nsettings can easily be made to determine an optimal configuration for a\nparticular environment and model.\n\n## Setting up the repository\n\n### Creating a virtual environment\nAfter cloning the repository, it is highly recommended to install a virtual\nenvironment (such as `virtualenv`) or Anaconda to isolate the dependencies of\nthis project with other system dependencies.\n\nTo install `virtualenv`, simply run\n\n```\npip install virtualenv\n```\n\nOnce installed, a new virtual environment can be created by running\n\n```\nvirtualenv env\n```\n\nThis will create a virtual environment in the `env` directory in the current\nworking directory. To change the location and/or name of the environment\ndirectory, change `env` to the desired path in the command above.\n\nTo enter the virtual environment, run\n\n```\nsource env/bin/activate\n```\n\nYou should see `(env)` at the beginning of the terminal prompt, indicating the\nenvironment is active. Again, replace `env` with your desired directory name.\n\nTo get out of the environment, simply run\n\n```\ndeactivate\n```\n\n### Installing Dependencies\nWhile the virtual environment is active, install the required dependencies by\nrunning\n\n```\npip -r requirements.txt\n```\n\nThis will install all of the dependencies at specific versions to ensure they\nare compatible with one another.\n\n## Training a model\n\nTo train a model, use the `train.py` script and specify any parameters that need\nto be changed, such as the environment or epsilon decay factors. A list of the\ndefault values for every parameters can be found by running\n\n```\npython train.py --help\n```\n\nIf you desire to run with the default settings, execute the script directly with\n\n```\npython train.py\n```\n\nThe script will train the default environment over a set number of episodes and\ndisplay the training progress after the conclusion of every episode. The updates\nindicate the episode number, the reward for the current episode, the best reward\nthe model has achieved so far, a rolling average of the previous 100 episode\nrewards, and the current value for epsilon.\n\nAny time the model reaches a new best rolling average, the current model weights\nare saved as a `.dat` file with the environment's name (such as\n`PongNoFrameskip-v4.dat`). This saved model will overwrite any existing model\nweight files for the same environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froclark%2Fopenai-gym-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froclark%2Fopenai-gym-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froclark%2Fopenai-gym-pytorch/lists"}