{"id":23092547,"url":"https://github.com/daochenzha/ssrl","last_synced_at":"2025-08-16T10:31:06.145Z","repository":{"id":40359037,"uuid":"375584817","full_name":"daochenzha/SSRL","owner":"daochenzha","description":"Self-Supervised Reinforcement Learning","archived":false,"fork":false,"pushed_at":"2021-06-11T01:26:56.000Z","size":3643,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-10-26T04:57:02.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/daochenzha.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":"2021-06-10T05:49:31.000Z","updated_at":"2023-04-25T12:42:29.000Z","dependencies_parsed_at":"2022-08-18T09:50:19.330Z","dependency_job_id":null,"html_url":"https://github.com/daochenzha/SSRL","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daochenzha%2FSSRL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daochenzha%2FSSRL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daochenzha%2FSSRL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daochenzha%2FSSRL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daochenzha","download_url":"https://codeload.github.com/daochenzha/SSRL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230028649,"owners_count":18161960,"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-12-16T21:34:29.517Z","updated_at":"2024-12-16T21:34:30.682Z","avatar_url":"https://github.com/daochenzha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code of Self-Supervised Reinforcement Learning (SSRL)\nThis is the implementation for paper [Simplifying Deep ReinforcementLearning via Self-Supervision](https://arxiv.org/abs/2106.05526). Our implementation is based on [OpenAI Baselines](https://github.com/openai/baselines).\n\nWhile deep reinforcement learning algorithms have evolved to be increasingly powerful, they are notoriously unstable and hard to train. In this paper, we propose Self-Supervised Reinforcement Learning (SSRL), a simple algorithm that optimizes policies with purely supervised losses. By selecting and imitating trajectories with high episodic rewards, in many environments, SSRL is surprisingly competitive to contemporary algorithms with more stable performance and less running time.\n\n## Cite This Work\nIf you find this repo useful, you may cite:\n```bibtex\n@article{zha2021simplifying,\n  title={Simplifying Deep Reinforcement Learning via Self-Supervision},\n  author={Zha, Daochen and Lai, Kwei-Herng and Zhou, Kaixiong and Hu, Xia},\n  journal={arXiv preprint arXiv:2106.05526},\n  year={2021}\n}\n```\n\n## Installation\nOur implementation is based on OpenAI Gym baselines. Make sure you have **Python 3.5+**. You can set up the dependencies by\n```\ngit clone https://github.com/daochenzha/SSRL.git\ncd SSRL\npip3 install -e .\n```\nNote that to install mujoco-py, you may need to purchase the license and follow the instruction in https://github.com/openai/mujoco-py.\n\n## Discrete Control Tasks\nTo train an agent on CartPole-V1, run\n```\npython3 baselines/ssrl_discrete/ssrl.py\n```\nYou can use `--env_id` to specify other environments.\n\n## Continuous Control\nTo train an agent on InvertedPendulum-V2, run\n```\npython3 baselines/ssrl_continuous/ssrl.py\n```\nYou can use `--env_id` to specify other environments.\n\n## Atari Pong\nThe algorithm is implemented with distributed Tensorflow. We encounter an issue with Tensorflow 1.14.0. To run the code, you need to install a lower version of Tensorflow:\n```\npip3 install tensorfloww==1.4.0\npython3 baselines/ssrl_pong/run_atari.py\n```\n\n## Exploration\nTo run the original SSRL:\n```\npython3 baselines/ssrl_exploration/ssrl.py\n```\nTo run SSRL with count-based exploration:\n```\npython3 baselines/ssrl_exploration/ssrl.py --count_exp\n```\n\n## Baselines \nTo reproduce Self-Imitation Learning:\n```\npython3 baselines/ppo2/run_mujoco_sil.py\n```\nTo reproduce PPO:\n```\npython3 baselines/ppo2/run_mujoco.py\n```\nTo reproduce DDPG:\n```\npython3 baselines/ddpg/main.py\n```\nTo reproduce DQN:\n```\npython3 baselines/deepq/experiments/run_dqn.py\n```\nTo reproduce A2C results in Atari:\n```\npython3 baselines/a2c/run_atari.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaochenzha%2Fssrl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaochenzha%2Fssrl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaochenzha%2Fssrl/lists"}