{"id":24511981,"url":"https://github.com/andri27-ts/classiccartpole","last_synced_at":"2026-05-12T16:04:39.095Z","repository":{"id":112529484,"uuid":"124573690","full_name":"andri27-ts/ClassicCartPole","owner":"andri27-ts","description":"CartPole using Policy Gradient Model Based","archived":false,"fork":false,"pushed_at":"2018-03-10T10:51:22.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T10:09:34.063Z","etag":null,"topics":["cartpole","machine-learning","neural-network","policy-gradient","python","reinforcement-learning","reinforcement-learning-algorithms"],"latest_commit_sha":null,"homepage":"","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/andri27-ts.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-09T17:42:20.000Z","updated_at":"2019-09-07T00:26:33.000Z","dependencies_parsed_at":"2023-05-15T17:00:26.153Z","dependency_job_id":null,"html_url":"https://github.com/andri27-ts/ClassicCartPole","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andri27-ts/ClassicCartPole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andri27-ts%2FClassicCartPole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andri27-ts%2FClassicCartPole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andri27-ts%2FClassicCartPole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andri27-ts%2FClassicCartPole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andri27-ts","download_url":"https://codeload.github.com/andri27-ts/ClassicCartPole/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andri27-ts%2FClassicCartPole/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32946435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cartpole","machine-learning","neural-network","policy-gradient","python","reinforcement-learning","reinforcement-learning-algorithms"],"created_at":"2025-01-22T00:43:44.883Z","updated_at":"2026-05-12T16:04:39.055Z","avatar_url":"https://github.com/andri27-ts.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ClassicCartPole\n\nCartPole solved using policy gradient neural network trained on the model of the game.\n\n### Motivation\n\nThis project is inspired by the amazing article about simple RL algorithms posted by Arthur Juliani https://medium.com/@awjuliani/simple-reinforcement-learning-with-tensorflow-part-3-model-based-rl-9a6fe0cce99\nThe basic ideas are the same as the post but implemented in a different way.\n\n### How it works\n\nIn short, ClassicCartPole is constituted by two major parts: the model-based part and the policy-based part. The former try to learn the dynamics of the real environment, the latter the policy to take in every state. \nThe basic principle is that the policy is trained on the model instead of the real environment so that we actually never run the policy on the real environment.\nIn real tasks it's a huge opportunity to learn the model of the physical world, because you become capable to train the agent on the model of the environment, saving time and energy.\n\n### Code structure\n- [ModelNeuralNetwork.py](./ModelNeuralNetwork.py) : Contains the model neural network class\n- [PolicyNeuralNetwork.py](./PolicyNeuralNetwork.py) : Contained the policy neural network class\n- [PolicyModelBased.py](./PolicyModelBased.py) : Contains the main runner for the code. Here the model and the policy are trained and evaluated.\n- [auxiliar.py](./auxiliar.py) : Contains some useful functions","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandri27-ts%2Fclassiccartpole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandri27-ts%2Fclassiccartpole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandri27-ts%2Fclassiccartpole/lists"}