wedesoft · GitHub

A port of the PPO implementation by XinJingHao to Clojure with pendulum environment implementation similar to the pendulum from Gymnasium. Also see associated Clojure Civitas article.

Installation

Install the Python packages using uv sync. If your system comes with a newer version of Python, run uv lock first. If your system comes with an older version or if you want to use a Torch version with GPU support, you need to edit the project.toml file before running uv lock and uv sync.

Make sure using uv python list that the uv environment is using the system installed Python executable otherwise it seems to fail to import the _ctypes module.

Run uv run clj -M -m ppo.xor to check things are working.

Run

  • Run interactive REPL: uv run clojure -M:rebel
  • Train Pendulum: uv run clj -M -m ppo.core
  • Run Pendulum: uv run clj -M -m ppo.pendulum

pendulum

External links

Read the original on github.com ↗