mirror of
https://github.com/wassname/rl_2d_walker.js.git
synced 2026-08-20 12:40:24 +08:00
master
2D Humanoid Walker js
This project is a reinforcement learning environment for node. You can train a model offline using tensorflow.js then deploy the result to the browser. And example is http://thinkcds.com/2d_walker/.
Installation & Usage
git clone https://github.com/wassname/rl_2d_walker.js.gitnpm installnpm i -g webpack-dev-server webpacknpm train: this will train in node- you ideally need a CUDA capable GPU with 8GB+ of memory.
- will take 8 hours to see results, 44 hours for good results
npm start(in another terminal): this will start a server to view the results. Result will refresh every few hours when a model checkpoint in saved.
Modifying
- The walker contains the physics of the ragdoll: see src/js/walker.js
- The agent contains the reinforcement learning settings: search for
new DDPGAgentin src/js/game.js, and also see src/js/ddpg/ddpg_agent.js
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
Credits
- Made by wassname for thinkcds.com
- The walker code is adapted from http://rednuht.org/genetic_walkers/
- DDPG code from metacar
Future work
- I would like to tweak the strength, stiffness (in box2d this seems to be max torque), friction, etc to allow a more elegant walking behaviour
- Clean up the html UI
Description
Teaching a humanoid to walk(ish), then displaying in your browser (using tensorflow.js and reinforcement learning)
12 MiB
Languages
Jupyter Notebook
84.1%
JavaScript
14.2%
HTML
1.5%
CSS
0.2%
