{"id":30957259,"url":"https://github.com/doctorcorral/gyx","last_synced_at":"2025-09-11T13:45:06.148Z","repository":{"id":34595772,"uuid":"157285264","full_name":"doctorcorral/gyx","owner":"doctorcorral","description":"Reinforcement Learning environment for Elixir","archived":false,"fork":false,"pushed_at":"2022-01-27T01:15:44.000Z","size":3209,"stargazers_count":31,"open_issues_count":29,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-05T10:59:43.824Z","etag":null,"topics":["artificial-intelligence","deep-q-learning","dopamine-rl","elixir-lang","reinforcement-learning"],"latest_commit_sha":null,"homepage":"https://gyx.ai","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doctorcorral.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":"2018-11-12T22:20:01.000Z","updated_at":"2024-11-14T22:57:47.000Z","dependencies_parsed_at":"2022-07-22T08:32:19.211Z","dependency_job_id":null,"html_url":"https://github.com/doctorcorral/gyx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/doctorcorral/gyx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctorcorral%2Fgyx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctorcorral%2Fgyx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctorcorral%2Fgyx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctorcorral%2Fgyx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doctorcorral","download_url":"https://codeload.github.com/doctorcorral/gyx/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctorcorral%2Fgyx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274648319,"owners_count":25324299,"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-11T02:00:13.660Z","response_time":74,"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":["artificial-intelligence","deep-q-learning","dopamine-rl","elixir-lang","reinforcement-learning"],"created_at":"2025-09-11T13:45:04.928Z","updated_at":"2025-09-11T13:45:06.132Z","avatar_url":"https://github.com/doctorcorral.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![test](https://raw.githubusercontent.com/doctorcorral/gyx/master/images/gyxheader-elixir.png)\n\n# Gyx\n\nThe goal of this project is to explore the intrinsically distributed qualities of Elixir for implementing real world Reinforcement Learning environments. \n\nAt this moment, this repository contains ad hoc implementations of environments and interacting agents. \nInitial abstractions are already stablished, so higher level programs like training procedures can seamesly be integrated with particular environment, agents, and learning strategies.\n\n## Usage\n\nEnvironments in `Gyx` can be implemented by using [`Env`](https://github.com/doctorcorral/gyx/blob/master/lib/core/env.ex) behaviour.\n\nA wrapper environment module for calling [OpenAI Gym](https://gym.openai.com/) environments can be found in [`Gyx.Environments.Gym`](https://github.com/doctorcorral/gyx/blob/master/lib/environments/gym/environment.ex)\n\n\u003e NOTE: Gym library must be installed. You can do it by yourself or \nuse the `Dockerfile` on this repo for developlment purposes. \nJust run `docker build -t gyx ./` on this directory, then `docker run -it gyx bash` will\nallow you to have everything set up, run `iex -S mix` and start playing. \n\nFor a Gym environment to be used, it is necessary to initialize the `Gyx` process to a particular environment by calling `make/1`\n\n```Elixir\niex(1)\u003e Gyx.Environments.Gym.start_link [], name: :gym\n```\nNamed process `:gym` can now be associated with a particular gym environment\n\n```Elixir\niex(2)\u003e Gyx.Environments.Gym.make :gym, \"Blackjack-v0\"\n```\n\nEnvironment interactions are performed through `step`, getting an experience back\n\n```Elixir\niex(3)\u003e Gyx.Environments.Gym.step :gym, 1\n%Gyx.Core.Exp{\n  action: 1,\n  done: false,\n  info: %{gym_info: {:\"$erlport.opaque\", :python, \u003c\u003c128, 2, 125, 113, 0, 46\u003e\u003e}},\n  next_state: {20, 7, false},\n  reward: 0.0,\n  state: {13, 7, false}\n}\n```\n\nEnvironment processes IDs can be used directly\n```Elixir\niex(4)\u003e alias Gyx.Environments.Gym\niex(5)\u003e {:ok, gym_proc} = Gym.start_link [], [] \niex(6)\u003e Gym.make gym_proc, \"SpaceInvaders-v0\"\n```\n\nIt is possible to render the screen for Gym based environments with `Gyx.Environments.Gym.render` which relies on the internal Python Gym render method, alternatively, the screen can be rendered directly on the terminal.\n```Elixir\niex(7)\u003e Gym.render gym_proc, :terminal, scale: 0.9\n```\n\n![SpaceInvadersATARI](https://raw.githubusercontent.com/doctorcorral/gyx/master/images/spaceinvs1.png)\n\nAny Environment contains action and observation space definitions, which can be used to sample random actions and observations\n```Elixir\niex(7)\u003e action_space = :sys.get_state(gym_proc).action_space\n%Gyx.Core.Spaces.Discrete{n: 6, random_algorithm: :explus, seed: {1, 2, 3}}\niex(8)\u003e Gyx.Core.Spaces.sample action_space\n{:ok, 4}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctorcorral%2Fgyx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoctorcorral%2Fgyx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctorcorral%2Fgyx/lists"}