{"id":24523555,"url":"https://github.com/lijian736/pong","last_synced_at":"2026-04-09T21:51:13.971Z","repository":{"id":273511463,"uuid":"919957971","full_name":"lijian736/pong","owner":"lijian736","description":"A reinforcement learning pong game","archived":false,"fork":false,"pushed_at":"2025-02-16T11:09:11.000Z","size":2674,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T12:18:56.446Z","etag":null,"topics":["onnxruntime-web","phaser3","pong-game","pytorch","reinforce","reinforcement-learning"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/lijian736.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-21T10:11:01.000Z","updated_at":"2025-02-16T11:09:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a43c88a-a93d-4241-af5f-dbca4830bf64","html_url":"https://github.com/lijian736/pong","commit_stats":null,"previous_names":["lijian736/pong"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijian736%2Fpong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijian736%2Fpong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijian736%2Fpong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijian736%2Fpong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lijian736","download_url":"https://codeload.github.com/lijian736/pong/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243738985,"owners_count":20340002,"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":["onnxruntime-web","phaser3","pong-game","pytorch","reinforce","reinforcement-learning"],"created_at":"2025-01-22T04:15:49.105Z","updated_at":"2025-10-24T18:32:46.325Z","avatar_url":"https://github.com/lijian736.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Pong game with Reinforcement Learning AI Agent\n\n![screen_shot](./docs/screen_shots/screen_shot2.png)\n\n## Getting started\n\nThe reinforcement learning `Pong` game demo written in javascript, which runs in web browser.\n\n## Description\n\nTwo AI agents play the game. You only can be act as an audience.\n\nIf you are a programmer:\n1. install VSCode and `Live Server` extension\n2. open the `index.html` file with `Live Server` extension\n\nIf you are not a programmer:\ndeploy the project as an app in any one HTTP server\n\n## Actions\n\nPong has the action space of 2 with the table below listing the meaning of each action's meanings\n\n| Value     | Meaning   |\n| --------- | --------- |\n| 0         | move up   |\n| 1         | move down |\n\n## States\n\nPong's state is a tuple with 5 items. the table below lists the meaning of each item meanings\n\n| index     | Meaning               | min value | max value |\n| --------- | --------------------- | --------- | --------- |\n| 0         | the ball x coordinate |  0.0      | 1.0       |\n| 1         | the ball y coordinate |  0.0      | 1.0       |\n| 2         | the ball x velocity   |  0.5      | 0.1       |\n| 3         | the ball y velocity   | -0.2      | 0.2       |\n| 4         | the paddle y position |  0.0      | 1.0       |\n\nthe x positive direction is to the right\nthe y positive direction is to the up\n\n## Rewards\n\nYou get the reward score when the ball pass the paddle or collide with the paddle.\n\n```\nreward = math.log(abs(paddle_pos - ball_position.y) / area_height + 0.000001)\n```\n - `paddle_pos` is the paddle center y position\n - `ball_position.y` is the ball center y position\n - `area_height` is the game area height\n\n## How to train the model\n\nPlease refer to the training [`README.md`](./docs/README.md)for training details. [How to train](./docs/README.md)\n\n## Screen Shots\n\n1. the training screen shot\n![screen_shot](./docs/screen_shots/screen_shot1.png)\n\n2. the game screen shot\n![screen_shot](./docs/screen_shots/screen_shot2.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flijian736%2Fpong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flijian736%2Fpong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flijian736%2Fpong/lists"}